From 305f9bb7e9256a7d8048986f1049165a3031b6d2 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Sat, 3 Feb 2024 11:02:59 -0600 Subject: [PATCH] Fixbuild issue --- routers/web/auth/auth.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 68a1fa0c50..1506b9540a 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -377,15 +377,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