mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-22 20:42:40 +00:00
Use mail handle if oauth nickname is empty (#362)
This commit is contained in:
parent
d5e66d3994
commit
7cc2b497ca
1 changed files with 4 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue