🐛 Fix userinfo subject should be string
All checks were successful
release-nightly / build-docker (push) Successful in 3m18s

This commit is contained in:
LittleSheep 2024-01-30 22:09:07 +08:00
parent 997ada9da6
commit 39904dc08c

View File

@ -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