automatic insertion of test user

main
Nilo Roberto C Paim 2024-08-19 18:49:31 -03:00
parent c373a34578
commit 788196cc3e
1 changed files with 8 additions and 0 deletions

View File

@ -221,6 +221,14 @@ func Checkuser(c *fiber.Ctx) error {
if user.ID == 0 {
// The user is not found, so it's an eligible tester; let's signalize this
response.Type = "T"
// Insert the user in the database
u := models.User{
Email: email,
UserType: "T",
TestStatus: "TS", // Awaiting test done
}
database.DB.Create(&u)
} else {
// The user is found and it's an admin; let's signalize this
if user.UserType == "A" {