diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index de16a2d66d..b9ae67abad 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -372,7 +372,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