From bef5624ff7b08ad8c97e1056b1441d564cc0b48d Mon Sep 17 00:00:00 2001 From: Arzumify Date: Sat, 4 May 2024 19:18:15 +0100 Subject: [PATCH] Made user return correctly from userinfo and make the sub correct in the id token --- main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index d9975d6..1fb8c90 100644 --- a/main.go +++ b/main.go @@ -577,9 +577,7 @@ func main() { return } - user := gin.H{"name": username, "sub": uniqueid} - - c.JSON(200, gin.H{"sub": uniqueid, "user": user}) + c.JSON(200, gin.H{"sub": uniqueid, "name": username}) }) router.POST("/api/uniqueid", func(c *gin.Context) { @@ -737,7 +735,7 @@ func main() { return } - _, username, _, _, norows := get_user(userid) + _, username, _, uniqueid, norows := get_user(userid) if norows { c.String(400, "User does not exist") @@ -773,7 +771,7 @@ func main() { } datatemplate := jwt.MapClaims{ - "sub": username, + "sub": uniqueid, "iss": "https://auth.hectabit.org", "name": username, "aud": appId,