mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-11-01 00:49:04 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			431 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 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)
 | |
| }
 |