Skip to content

Commit

Permalink
fix oauth token expire time
Browse files Browse the repository at this point in the history
  • Loading branch information
BK1031 committed Sep 29, 2024
1 parent fc5b675 commit abba911
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controller/oauth_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ func handleAuthorizationCodeExchange(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"message": err.Error()})
return
}
token, err := service.GenerateAccessToken(authCode.UserID, authCode.Scope, authCode.ClientID, 24*60)
token, err := service.GenerateAccessToken(authCode.UserID, authCode.Scope, authCode.ClientID, 60*60)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": err.Error()})
return
}
idToken := ""
if strings.Contains(authCode.Scope, "openid") {
idToken, err = service.GenerateIDToken(authCode.UserID, authCode.Scope, authCode.ClientID, 24*60)
idToken, err = service.GenerateIDToken(authCode.UserID, authCode.Scope, authCode.ClientID, 60*60)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": err.Error()})
return
Expand Down

0 comments on commit abba911

Please sign in to comment.