Make the nickname claim conditional on the openid scope too
This is only needed for OIDC anyway
This commit is contained in:
parent
f4be6e135a
commit
aec65d8e19
|
@ -61,9 +61,10 @@ func UserInfo(ctx *gin.Context) {
|
|||
|
||||
if s == "openid" {
|
||||
userinfoRes["sub"] = *tokenInfo.Sub
|
||||
} else if s == "username" {
|
||||
// Add "nickname" field for OIDC compatibility
|
||||
userinfoRes["nickname"] = userinfoRes[s]
|
||||
if value, ok := (*userinfo)["username"]; ok {
|
||||
// Add "nickname" field for OIDC compatibility
|
||||
userinfoRes["nickname"] = value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue