From 39904dc08c9427f7c97bab7800ed28ae8ea78b2b Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 30 Jan 2024 22:09:07 +0800 Subject: [PATCH] :bug: Fix userinfo subject should be string --- pkg/server/accounts_api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/server/accounts_api.go b/pkg/server/accounts_api.go index 3f0439f..167f423 100644 --- a/pkg/server/accounts_api.go +++ b/pkg/server/accounts_api.go @@ -8,6 +8,7 @@ import ( "github.com/gofiber/fiber/v2" jsoniter "github.com/json-iterator/go" "github.com/spf13/viper" + "strconv" ) func getPrincipal(c *fiber.Ctx) error { @@ -29,7 +30,7 @@ func getPrincipal(c *fiber.Ctx) error { raw, _ := jsoniter.Marshal(data) jsoniter.Unmarshal(raw, &resp) - resp["sub"] = data.ID + resp["sub"] = strconv.Itoa(int(data.ID)) resp["family_name"] = data.Profile.FirstName resp["given_name"] = data.Profile.LastName resp["name"] = data.Name