netmaker/models/ssocache.go
Vishal Dalwadi 31ed8c5262
Netmaker Desktop Session Duration (#3543)
* feat(go): allow different session durations for client apps;

* feat(go): assume call is from netdesk app if header absent;

* feat(go): allow header;

* feat(go): set client jwt validity duration on migration.
2025-07-27 08:29:14 +05:30

18 lines
471 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 {
AppName string `json:"app_name"`
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)
}