Verbose debug printing in register endpoint
This commit is contained in:
parent
9240d5e052
commit
3683552af8
1 changed files with 3 additions and 0 deletions
|
@ -22,13 +22,16 @@ import (
|
|||
func (gs *GState) Register(c *fiber.Ctx) error {
|
||||
u := new(types.NewUser)
|
||||
if err := c.BodyParser(u); err != nil {
|
||||
println("Error parsing body")
|
||||
return c.Status(400).SendString(err.Error())
|
||||
}
|
||||
|
||||
println("Adding user:", u.Username)
|
||||
if err := gs.Db.AddUser(u.Username, u.Password); err != nil {
|
||||
return c.Status(500).SendString(err.Error())
|
||||
}
|
||||
|
||||
println("User added:", u.Username)
|
||||
return c.Status(200).SendString("User added")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue