Skip to content

Commit 3b70eef

Browse files
committed
fix(auth): set default expiry for loaded OAuth2 token to ensure proper renewal
1 parent db9e5a9 commit 3b70eef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/dbio/api/auth.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,8 @@ func (a *AuthenticatorOAuth2) SaveToken(tok *oauth2.Token) error {
674674

675675
// LoadToken loads the stored token.
676676
func (a *AuthenticatorOAuth2) LoadToken() (*oauth2.Token, error) {
677-
tok := &oauth2.Token{}
677+
// set default expiry, token renew needs it
678+
tok := &oauth2.Token{Expiry: time.Now().Add(-1 * time.Hour)}
678679

679680
// attempt to load from secrets first, then from file
680681
err := g.Unmarshal(g.Marshal(a.conn.State.Secrets), tok)

0 commit comments

Comments
 (0)