diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 1506b9540a..4719ee7e6c 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -377,7 +377,7 @@ func handleSignInFull(ctx *context.Context, u *user_model.User, remember, obeyRe } func getUserName(gothUser *goth.User) (string, error) { - return user_model.NormalizeUserName(gothUser.RawData["preferred_username"].(string)) + return user_model.NormalizeUserName(strings.Split(gothUser.RawData["preferred_username"].(string), "@")[0]) } // HandleSignOut resets the session and sets the cookies