diff --git a/internal/web/auth.go b/internal/web/auth.go index 1e21a6a..a396edb 100644 --- a/internal/web/auth.go +++ b/internal/web/auth.go @@ -162,6 +162,10 @@ func oauthCallback(ctx echo.Context) error { } if err = userDB.Create(); err != nil { + if getData(ctx, "signupDisabled") == true { + return errorRes(403, "Signing up is disabled", nil) + } + if models.IsUniqueConstraintViolation(err) { addFlash(ctx, "Username "+user.NickName+" already exists in Opengist", "error") return redirect(ctx, "/login")