f10f78590ad1e2060630cd2725e6bd983dbc3e43.svn-base 423 B

123456789101112131415161718192021222324252627
  1. package model
  2. import "time"
  3. type OAuth2Token struct {
  4. // 刷新令牌
  5. RefreshToken *OAuth2Token
  6. // 令牌类型
  7. TokenType string
  8. // 令牌
  9. TokenValue string
  10. // 过期时间
  11. ExpiresTime *time.Time
  12. }
  13. func (oauth2Token *OAuth2Token) IsExpired() bool {
  14. return oauth2Token.ExpiresTime != nil &&
  15. oauth2Token.ExpiresTime.Before(time.Now())
  16. }
  17. type OAuth2Details struct {
  18. Client ClientDetails
  19. User UserDetails
  20. }