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")