From 6ff69cdeb1dd7e2bedf906d7b8f356f8335d1547 Mon Sep 17 00:00:00 2001 From: Simon Esposito Date: Fri, 20 Oct 2023 13:19:56 +0100 Subject: [PATCH] Review changes --- server/api_session.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/server/api_session.go b/server/api_session.go index ce8ee55139..eb9bfa6c3d 100644 --- a/server/api_session.go +++ b/server/api_session.go @@ -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.