Error handling for CreateUser query
This commit is contained in:
parent
93a1cb6049
commit
a590c96d0b
@ -24,7 +24,12 @@ func (postController *PostController) Register(w http.ResponseWriter, r *http.Re
|
|||||||
http.Redirect(w, r, "/register", http.StatusFound)
|
http.Redirect(w, r, "/register", http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
models.CreateUser(postController.App, username, password, createdAt, updatedAt)
|
_, err := models.CreateUser(postController.App, username, password, createdAt, updatedAt)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Error creating user")
|
||||||
|
log.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
http.Redirect(w, r, "/login", http.StatusFound)
|
http.Redirect(w, r, "/login", http.StatusFound)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user