From 2f2a39d93d8f38480201386481d0721862c5b81a Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 16 Jul 2024 14:32:17 +0800 Subject: [PATCH] :bug: Wrong context key in authorization --- pkg/internal/server/exts/auth.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/internal/server/exts/auth.go b/pkg/internal/server/exts/auth.go index 5a8244c..435067b 100644 --- a/pkg/internal/server/exts/auth.go +++ b/pkg/internal/server/exts/auth.go @@ -3,13 +3,14 @@ package exts import ( "context" "fmt" + "strings" + "time" + "git.solsynth.dev/hydrogen/dealer/pkg/hyper" "git.solsynth.dev/hydrogen/dealer/pkg/internal/directory" "git.solsynth.dev/hydrogen/dealer/pkg/proto" "github.com/gofiber/fiber/v2" jsoniter "github.com/json-iterator/go" - "strings" - "time" ) func AuthMiddleware(c *fiber.Ctx) error { @@ -32,7 +33,7 @@ func AuthMiddleware(c *fiber.Ctx) error { if newAtk != atk { SetAuthCookies(c, newAtk, newRtk) } - c.Locals("user", acc) + c.Locals("p_user", acc) } return c.Next()