feat: Allow register locally without authentication

This commit is contained in:
Kasper Rynning-Tønnesen
2021-03-25 20:48:00 +01:00
parent ea10f95a22
commit 56072ff282

View File

@@ -87,8 +87,15 @@ router.get("/chat/history", chatController.getAllHistory);
router.delete("/chat/history", mustBeAuthenticated, chatController.deleteHistory);
router.post("/login", userController.login);
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);