feat: Allow register locally without authentication #83

Merged
kasperrt merged 2 commits from feat/register into master 2021-04-29 15:37:26 +00:00

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);