ssocache.go 471 B

123456789101112131415161718
  1. package models
  2. import "time"
  3. // DefaultExpDuration - the default expiration time of SsoState
  4. const DefaultExpDuration = time.Minute * 5
  5. // SsoState - holds SSO sign-in session data
  6. type SsoState struct {
  7. AppName string `json:"app_name"`
  8. Value string `json:"value"`
  9. Expiration time.Time `json:"expiration"`
  10. }
  11. // SsoState.IsExpired - tells if an SsoState is expired or not
  12. func (s *SsoState) IsExpired() bool {
  13. return time.Now().After(s.Expiration)
  14. }