🐛 Add compability on userinfo

This commit is contained in:
LittleSheep 2025-01-22 15:58:56 +08:00
parent 6a4f2b6869
commit 5b516094a0

View File

@ -2,11 +2,12 @@ package api
import ( import (
"fmt" "fmt"
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
"git.solsynth.dev/hypernet/passport/pkg/internal/http/exts" "git.solsynth.dev/hypernet/passport/pkg/internal/http/exts"
"git.solsynth.dev/hypernet/passport/pkg/authkit/models" "git.solsynth.dev/hypernet/passport/pkg/authkit/models"
@ -74,6 +75,7 @@ func getUserinfo(c *fiber.Ctx) error {
resp["name"] = data.Name resp["name"] = data.Name
resp["email"] = data.GetPrimaryEmail().Content resp["email"] = data.GetPrimaryEmail().Content
resp["preferred_username"] = data.Nick resp["preferred_username"] = data.Nick
resp["profile"] = data.Name
if data.Avatar != nil { if data.Avatar != nil {
resp["picture"] = *data.GetAvatar() resp["picture"] = *data.GetAvatar()