mirror of
https://github.com/thomiceli/opengist.git
synced 2025-06-13 05:47:12 +02:00
Use mail handle if oauth nickname is empty (#362)
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user