From 7cc2b497cafc23289ac46d1a6872e5fc337d15c5 Mon Sep 17 00:00:00 2001 From: Thomas Miceli <27960254+thomiceli@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:24:15 +0100 Subject: [PATCH] Use mail handle if oauth nickname is empty (#362) --- internal/web/auth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/web/auth.go b/internal/web/auth.go index aa8bfff..39d3d28 100644 --- a/internal/web/auth.go +++ b/internal/web/auth.go @@ -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,