Skip to content

Commit

Permalink
fix: temporary fix refresh error
Browse files Browse the repository at this point in the history
  • Loading branch information
TAK848 committed Mar 9, 2024
1 parent 99b202a commit dcbdc3c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions usecase/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,16 @@ func (au *authUsecase) RefreshToken(ctx context.Context, refreshToken string) (e
return entity.Token{}, err
}

// Revoke the previous refresh token
err = au.ar.DeleteRefreshToken(ctx, refreshToken)
if err != nil {
return entity.Token{}, err
}
go func() {
time.Sleep(3 * time.Second) // 暫定処置
// Revoke the previous refresh token
err = au.ar.DeleteRefreshToken(context.Background(), refreshToken)
if err != nil {
// return entity.Token{}, err
log.Println("refresh token delete error", err)
}
log.Println("refresh token deleted")
}()
return newAccessToken, nil

// return entity.Token{
Expand Down

0 comments on commit dcbdc3c

Please sign in to comment.