feat: Allow register locally without authentication
This commit is contained in:
@@ -87,8 +87,15 @@ router.get("/chat/history", chatController.getAllHistory);
|
|||||||
router.delete("/chat/history", mustBeAuthenticated, chatController.deleteHistory);
|
router.delete("/chat/history", mustBeAuthenticated, chatController.deleteHistory);
|
||||||
|
|
||||||
router.post("/login", userController.login);
|
router.post("/login", userController.login);
|
||||||
router.post("/register", mustBeAuthenticated, userController.register);
|
|
||||||
router.get("/logout", userController.logout);
|
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);
|
// router.get("/", documentation.apiInfo);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user