Use mail handle if oauth nickname is empty (#362)

This commit is contained in:
Thomas Miceli 2024-10-31 18:24:15 +01:00 committed by GitHub
parent d5e66d3994
commit 7cc2b497ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -235,6 +235,10 @@ func oauthCallback(ctx echo.Context) error {
return errorRes(500, "Cannot get user", err)
}
if user.NickName == "" {
user.NickName = strings.Split(user.Email, "@")[0]
}
userDB = &db.User{
Username: user.NickName,
Email: user.Email,