mirror of
https://github.com/thomiceli/opengist.git
synced 2025-06-23 02:07:58 +02:00
Block Oauth when signup is disabled
This commit is contained in:
@ -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")
|
||||
|
Reference in New Issue
Block a user