From 79d0cc3771e071685552104db91ac957ff68e326 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Sat, 21 Jan 2023 21:54:33 +0530 Subject: [PATCH] add ip option to signup --- pages/signup.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pages/signup.go b/pages/signup.go index 5d7aa07..c242317 100644 --- a/pages/signup.go +++ b/pages/signup.go @@ -15,8 +15,9 @@ func SignupPage(c *fiber.Ctx) error { username := c.FormValue("username") email := c.FormValue("email") ssh := c.FormValue("ssh") - if username == "" || email == "" || ssh == "" { - log.Error("username, email and ssh must be filled", username, email, ssh) + ip := c.FormValue("ip") + if username == "" || email == "" || ssh == "" || ip == "" { + log.Error("username, email, ssh and ip must be filled", username, email, ssh, ip) return c.SendStatus(fiber.StatusBadRequest) } @@ -63,7 +64,7 @@ func SignupPage(c *fiber.Ctx) error { log.Info("Registration request for " + username + " has been submitted by the frontend and has been written to /var/publapi/users/" + username + ".sh") // send notification to admins - err = shoutrrr.Send(os.Getenv("PUBLAPI_SHOUTRRRURL"), "New user signup! Please review /var/publapi/users/"+username+".sh to approve or deny the user.") + err = shoutrrr.Send(os.Getenv("PUBLAPI_SHOUTRRRURL"), "New user signup! Please review /var/publapi/users/"+username+".sh to approve or deny the user. IP: "+ip+" Email: "+email) if err != nil { log.Error("Error sending notification to admins", err) return c.SendStatus(fiber.StatusInternalServerError)