Skip to content

Commit

Permalink
Use mail handle if oauth nickname is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
thomiceli committed Oct 31, 2024
1 parent d5e66d3 commit f1a96a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/web/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f1a96a5

Please sign in to comment.