Fix auth refresh token configuration
Prior version didn't push refresh exparation forward so an expired refresh token could be issued.
This commit is contained in:
@@ -136,10 +136,6 @@ func (c tokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.To
|
||||
return nil, fmt.Errorf("failed to get refresh token: %w", err)
|
||||
}
|
||||
|
||||
if t.ExpiresAt.Before(*now()) {
|
||||
//return nil, oauth2errors.ErrExpiredRefreshToken
|
||||
}
|
||||
|
||||
return internal, t.Data.Unmarshal(internal)
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,13 @@ func NewManager(opt options.AuthOpt, log *zap.Logger, cs oauth2.ClientStore, ts
|
||||
// token store
|
||||
manager.MapTokenStorage(ts)
|
||||
manager.MapClientStorage(cs)
|
||||
// Change the default config for it to update refresh token timestamps
|
||||
// else the refresh token timestamp remains the same
|
||||
//
|
||||
// @note do this so we don't change the default `manage` package var
|
||||
rcfg := *manage.DefaultRefreshTokenCfg
|
||||
rcfg.IsResetRefreshTime = true
|
||||
manager.SetRefreshTokenCfg(&rcfg)
|
||||
|
||||
manager.SetValidateURIHandler(func(baseURI, redirectURI string) (err error) {
|
||||
if baseURI == "" {
|
||||
|
||||
Reference in New Issue
Block a user