7// Token represents an OAuth2 token from Claude Code Max.
9 AccessToken string `json:"access_token"`
10 RefreshToken string `json:"refresh_token"`
11 ExpiresIn int `json:"expires_in"`
12 ExpiresAt int64 `json:"expires_at"`
15// SetExpiresAt calculates and sets the ExpiresAt field based on the current time and ExpiresIn.
16func (t *Token) SetExpiresAt() {
17 t.ExpiresAt = time.Now().Add(time.Duration(t.ExpiresIn) * time.Second).Unix()
20// IsExpired checks if the token is expired or about to expire (within 10% of its lifetime).
21func (t *Token) IsExpired() bool {
22 return time.Now().Unix() >= (t.ExpiresAt - int64(t.ExpiresIn)/10)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list