Update auth, question, answer

This commit is contained in:
AndrewTrieu
2023-03-09 14:16:17 +02:00
parent 67b0a911c2
commit e6d68e98d6
4 changed files with 81 additions and 1 deletions

View File

@@ -27,7 +27,6 @@ const createUser = async ({ request, response, render }) => {
response.status = 422;
userData.errors = errors;
render("register.eta", userData);
return;
} else {
const hashedPassword = await bcrypt.hash(userData.password);
const user = await authServices.createUser(userData.email, hashedPassword);

View File

@@ -8,5 +8,8 @@ router.get("/", mainController.showMain);
router.get("/auth/login", authController.showLogin);
router.get("/auth/register", authController.showRegister);
router.post("/auth/login", authController.login);
router.get("/topics", topicController.listTopics);
router.post("/topics", topicController.addTopic);
router.get("/topics/:id/delete", topicController.deleteTopic);
export { router };