Fixbuild issue
Some checks failed
testing / test-sqlite (push) Blocked by required conditions
mirror / mirror (push) Has been skipped
testing / lint-backend (push) Successful in 15m47s
testing / checks-backend (push) Successful in 5m33s
testing / test-unit (push) Successful in 14m2s
testing / test-mysql (push) Failing after 40m4s
testing / test-pgsql (push) Has been cancelled

This commit is contained in:
Anthony Lawn 2024-02-03 11:02:59 -06:00
parent 2488750ea4
commit c767787740

View file

@ -372,15 +372,7 @@ func handleSignInFull(ctx *context.Context, u *user_model.User, remember, obeyRe
}
func getUserName(gothUser *goth.User) (string, error) {
return gothUser.RawData["preferred_username"]
// switch setting.OAuth2Client.Username {
// case setting.OAuth2UsernameEmail:
// return user_model.NormalizeUserName(strings.Split(gothUser.Email, "@")[0])
// case setting.OAuth2UsernameNickname:
// return user_model.NormalizeUserName(gothUser.NickName)
// default: // OAuth2UsernameUserid
// return gothUser.UserID, nil
// }
return user_model.NormalizeUserName(gothUser.RawData["preferred_username"].(string))
}
// HandleSignOut resets the session and sets the cookies