mirror of
https://github.com/thomiceli/opengist
synced 2025-02-21 17:19:34 +01:00
Block Oauth when signup is disabled
This commit is contained in:
parent
2d42cf798c
commit
6a0fd92516
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user