chore: rename context name

This commit is contained in:
Steven
2023-09-17 16:21:11 +08:00
parent 75d152922e
commit 6cb493b4a1
8 changed files with 23 additions and 23 deletions

View File

@ -23,7 +23,7 @@ type ContextKey int
const (
// The key name used to store user id in the context
// user id is extracted from the jwt token subject field.
UserIDContextKey ContextKey = iota
userIDContextKey ContextKey = iota
)
// GRPCAuthInterceptor is the auth interceptor for gRPC server.
@ -80,7 +80,7 @@ func (in *GRPCAuthInterceptor) AuthenticationInterceptor(ctx context.Context, re
}
// Stores userID into context.
childCtx := context.WithValue(ctx, UserIDContextKey, userID)
childCtx := context.WithValue(ctx, userIDContextKey, userID)
return handler(childCtx, request)
}