mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-14 13:44:37 +08:00
18 lines
431 B
Go
18 lines
431 B
Go
|
package models
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
// DefaultExpDuration - the default expiration time of SsoState
|
||
|
const DefaultExpDuration = time.Minute * 5
|
||
|
|
||
|
// SsoState - holds SSO sign-in session data
|
||
|
type SsoState struct {
|
||
|
Value string `json:"value"`
|
||
|
Expiration time.Time `json:"expiration"`
|
||
|
}
|
||
|
|
||
|
// SsoState.IsExpired - tells if an SsoState is expired or not
|
||
|
func (s *SsoState) IsExpired() bool {
|
||
|
return time.Now().After(s.Expiration)
|
||
|
}
|