diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2017-04-10 14:38:14 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2017-04-10 14:38:14 +0100 |
commit | fae8497fcc0977bd368cce13407a1e79abb3f1c8 (patch) | |
tree | 64ec89f61ce0d50d201686cc3c0f12723101b05d | |
parent | 044fae60a04c06b622554b9f2e9c5f61233355cc (diff) |
obtain the username before revoking the token
-rw-r--r-- | server/rpc.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/rpc.go b/server/rpc.go index ce95e96..45f84f0 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") } |