From 84a78b7a7e6e6c2777f12cbabee11cea1007636e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 17 Feb 2024 20:25:30 -0500 Subject: [PATCH] fix: use realKey --- api/middleware/middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/middleware/middleware.go b/api/middleware/middleware.go index a807a0f..64c8918 100644 --- a/api/middleware/middleware.go +++ b/api/middleware/middleware.go @@ -185,7 +185,7 @@ func GetUserFromContext(ctx context.Context, key ...string) uint { realKey = DEFAULT_AUTH_CONTEXT_KEY } - userId, ok := ctx.Value(key).(uint) + userId, ok := ctx.Value(realKey).(uint) if !ok { panic("user id stored in context is not of type uint")