Skip to content
Snippets Groups Projects

Resolve "Improve token usage for users"

Merged Neil-Jocelyn Schark requested to merge 378-improve-token-usage-for-users into master
1 file
+ 5
2
Compare changes
  • Side-by-side
  • Inline
@@ -155,7 +155,7 @@ func (s AuthServer) isCorrectPassword(storedPassword, salt, loginPassword string
@@ -155,7 +155,7 @@ func (s AuthServer) isCorrectPassword(storedPassword, salt, loginPassword string
}
}
// handleLogout checks if the provided user name matches with the one associated with token and
// handleLogout checks if the provided user name matches with the one associated with token and
// removed the token from all tokens of the user
// removed the token from all tokens of the user.
func (s AuthServer) handleLogout(ctx context.Context, userName string) error {
func (s AuthServer) handleLogout(ctx context.Context, userName string) error {
md, ok := metadata.FromIncomingContext(ctx)
md, ok := metadata.FromIncomingContext(ctx)
if !ok {
if !ok {
@@ -183,7 +183,10 @@ func (s AuthServer) handleLogout(ctx context.Context, userName string) error {
@@ -183,7 +183,10 @@ func (s AuthServer) handleLogout(ctx context.Context, userName string) error {
foundToken := false
foundToken := false
for _, storedToken := range storedTokens {
for _, storedToken := range storedTokens {
if storedToken == token {
if storedToken == token {
storedUser.RemoveToken(token)
err := storedUser.RemoveToken(token)
 
if err != nil {
 
return status.Errorf(codes.Aborted, "error checking match of token provied for user")
 
}
foundToken = true
foundToken = true
break
break
}
}
Loading