fix signup file containing info of prev signup

This commit is contained in:
Arya 2023-02-20 15:00:16 +05:30
parent bba3d72d95
commit a88f9c7398
Signed by: arya
GPG Key ID: 842D12BDA50DF120

View File

@ -38,11 +38,11 @@ func SignupPage(c *fiber.Ctx) error {
if chmoderr != nil { if chmoderr != nil {
log.Error(err) log.Error(err)
} }
utils.Bashscript = strings.ReplaceAll(utils.Bashscript, "{{sshkey}}", ssh) Bashscript := strings.ReplaceAll(utils.Bashscript, "{{sshkey}}", ssh)
utils.Bashscript = strings.ReplaceAll(utils.Bashscript, "{{email}}", email) Bashscript = strings.ReplaceAll(Bashscript, "{{email}}", email)
utils.Bashscript = strings.ReplaceAll(utils.Bashscript, "{{username}}", username) Bashscript = strings.ReplaceAll(Bashscript, "{{username}}", username)
// write to file // write to file
_, err = f.WriteString(utils.Bashscript) _, err = f.WriteString(Bashscript)
if err != nil { if err != nil {
log.Error("Error writing to user file", err) log.Error("Error writing to user file", err)
return c.SendStatus(fiber.StatusInternalServerError) return c.SendStatus(fiber.StatusInternalServerError)