From e22aa46ae74ad590b7d9bc1509561028e0b9b279 Mon Sep 17 00:00:00 2001 From: Midou Date: Mon, 10 Jul 2023 23:08:46 +0100 Subject: [PATCH] Replace the error code with an actual response for the end user. --- pages/signup.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/signup.go b/pages/signup.go index 7ddb287..7f145fb 100644 --- a/pages/signup.go +++ b/pages/signup.go @@ -93,9 +93,12 @@ func SignupPage(c *fiber.Ctx) error { if captchaResponse.Success == false { log.Error("Captcha validation failed") - return c.SendStatus(fiber.StatusBadRequest) + return c.JSON(fiber.Map{ + "username": username, + "message": "Sorry! But the captcha validation failed. Please try again.", + "status": c.Response().StatusCode(), + }) } else { - // create user file f, err := os.Create("/var/publapi/users/" + username + ".sh")