Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sesposito committed Oct 20, 2023
1 parent 021a0e6 commit 6ff69cd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions server/api_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ func (s *ApiServer) SessionRefresh(ctx context.Context, in *api.SessionRefreshRe
}
userIDStr := userID.String()

newTokenId := uuid.Must(uuid.NewV4()).String()
token, tokenExp := generateToken(s.config, newTokenId, userIDStr, username, useVars)
refreshToken, refreshTokenExp := generateRefreshToken(s.config, newTokenId, userIDStr, username, useVars)
s.sessionCache.Remove(userID, tokenExp, "", refreshTokenExp, tokenId)
s.sessionCache.Add(userID, tokenExp, newTokenId, refreshTokenExp, newTokenId)
//newTokenId := uuid.Must(uuid.NewV4()).String()
//token, tokenExp := generateToken(s.config, newTokenId, userIDStr, username, useVars)
//refreshToken, refreshTokenExp := generateRefreshToken(s.config, newTokenId, userIDStr, username, useVars)
//s.sessionCache.Remove(userID, tokenExp, "", refreshTokenExp, tokenId)
//s.sessionCache.Add(userID, tokenExp, newTokenId, refreshTokenExp, newTokenId)
//session := &api.Session{Created: false, Token: token, RefreshToken: refreshToken}

token, tokenExp := generateToken(s.config, tokenId, userIDStr, username, useVars)
refreshToken, _ := generateRefreshToken(s.config, tokenId, userIDStr, username, useVars)
session := &api.Session{Created: false, Token: token, RefreshToken: refreshToken}

// After hook.
Expand Down

0 comments on commit 6ff69cd

Please sign in to comment.