ssocache.go 431 B

1234567891011121314151617
  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. Value string `json:"value"`
  8. Expiration time.Time `json:"expiration"`
  9. }
  10. // SsoState.IsExpired - tells if an SsoState is expired or not
  11. func (s *SsoState) IsExpired() bool {
  12. return time.Now().After(s.Expiration)
  13. }