Skip to content
Snippets Groups Projects
Commit fae8497f authored by Niall Sheridan's avatar Niall Sheridan
Browse files

obtain the username before revoking the token

parent 044fae60
No related branches found
No related tags found
No related merge requests found
......@@ -53,8 +53,8 @@ func authInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServe
if !authprovider.Valid(token) {
return nil, grpc.Errorf(codes.PermissionDenied, "access denied")
}
authprovider.Revoke(token)
ctx = context.WithValue(ctx, usernameKey, authprovider.Username(token))
authprovider.Revoke(token)
default:
return nil, grpc.Errorf(codes.InvalidArgument, "unknown argument")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment