From a9faa1bc4488412f42d4926ab76b35f53cd008cd Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 15 Apr 2021 09:58:26 +0100 Subject: [PATCH] Fix registration error when disabled --- clientapi/routing/register.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index 872bdd736..526418669 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -614,7 +614,10 @@ func handleRegistrationFlow( } if cfg.RegistrationDisabled && r.Auth.Type != authtypes.LoginTypeSharedSecret { - return util.MessageResponse(http.StatusForbidden, "Registration has been disabled") + return util.JSONResponse{ + Code: http.StatusForbidden, + JSON: jsonerror.Forbidden("Registration is disabled"), + } } // Make sure normal user isn't registering under an exclusive application