Merge pull request #83 from KevinMidboe/feat/register

feat: Allow register locally without authentication
This commit is contained in:
2021-04-29 17:37:26 +02:00
committed by GitHub

View File

@@ -87,11 +87,14 @@ router.get("/chat/history", chatController.getAllHistory);
router.delete("/chat/history", mustBeAuthenticated, chatController.deleteHistory);
router.post("/login", userController.login);
// We should have a check here if we are dev/prod,
// and disable the mustBeAuthentacted for the register
router.post("/register", mustBeAuthenticated, userController.register);
router.get("/logout", userController.logout);
if(process.env !== "production") {
// We don't want to hide registering behind a
// authentication-wall if we are in dev
router.post("/register", userController.register);
} else {
router.post("/register", mustBeAuthenticated, userController.register);
}
// router.get("/", documentation.apiInfo);