fix: incorrect key of oidc username (close #5670)

This commit is contained in:
Andy Hsu
2023-12-10 13:17:56 +08:00
parent 026e944cbb
commit 296be88b5f
2 changed files with 3 additions and 3 deletions

View File

@ -231,7 +231,7 @@ func OIDCLoginCallback(c *gin.Context) {
common.ErrorResp(c, err, 400)
return
}
userID := utils.Json.Get(payload, conf.SSOOIDCUsernameKey).ToString()
userID := utils.Json.Get(payload, setting.GetStr(conf.SSOOIDCUsernameKey, "name")).ToString()
if userID == "" {
common.ErrorStrResp(c, "cannot get username from OIDC provider", 400)
return