From fae8497fcc0977bd368cce13407a1e79abb3f1c8 Mon Sep 17 00:00:00 2001
From: Niall Sheridan <nsheridan@gmail.com>
Date: Mon, 10 Apr 2017 14:38:14 +0100
Subject: [PATCH] obtain the username before revoking the token

---
 server/rpc.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/rpc.go b/server/rpc.go
index ce95e968..45f84f05 100644
--- a/server/rpc.go
+++ b/server/rpc.go
@@ -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")
 	}
-- 
GitLab