Made user return correctly from userinfo and make the sub correct in the id token

This commit is contained in:
Tracker-Friendly 2024-05-04 19:18:15 +01:00
parent 9c57a49f0c
commit bef5624ff7
1 changed files with 3 additions and 5 deletions

View File

@ -577,9 +577,7 @@ func main() {
return return
} }
user := gin.H{"name": username, "sub": uniqueid} c.JSON(200, gin.H{"sub": uniqueid, "name": username})
c.JSON(200, gin.H{"sub": uniqueid, "user": user})
}) })
router.POST("/api/uniqueid", func(c *gin.Context) { router.POST("/api/uniqueid", func(c *gin.Context) {
@ -737,7 +735,7 @@ func main() {
return return
} }
_, username, _, _, norows := get_user(userid) _, username, _, uniqueid, norows := get_user(userid)
if norows { if norows {
c.String(400, "User does not exist") c.String(400, "User does not exist")
@ -773,7 +771,7 @@ func main() {
} }
datatemplate := jwt.MapClaims{ datatemplate := jwt.MapClaims{
"sub": username, "sub": uniqueid,
"iss": "https://auth.hectabit.org", "iss": "https://auth.hectabit.org",
"name": username, "name": username,
"aud": appId, "aud": appId,