Fixbuild issue

This commit is contained in:
Anthony Lawn 2024-02-03 11:02:59 -06:00
parent 4684aa798f
commit 305f9bb7e9

View file

@ -377,15 +377,7 @@ func handleSignInFull(ctx *context.Context, u *user_model.User, remember, obeyRe
} }
func getUserName(gothUser *goth.User) (string, error) { func getUserName(gothUser *goth.User) (string, error) {
return gothUser.RawData["preferred_username"] return user_model.NormalizeUserName(gothUser.RawData["preferred_username"].(string))
// 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
// }
} }
// HandleSignOut resets the session and sets the cookies // HandleSignOut resets the session and sets the cookies