This commit is contained in:
2020-04-10 17:04:50 -04:00
parent 0c337716d3
commit 5266aec2b1
14 changed files with 300 additions and 244 deletions

View File

@ -17,6 +17,18 @@ router.post('/login', async function(req, res, next){
}
});
router.all('/logout', async function(req, res, next){
try{
if(req.user){
await req.user.logout();
}
res.json({message: 'Bye'})
}catch(error){
next(error);
}
});
router.post('/invite/:token', async function(req, res, next) {
try{
req.body.token = req.params.token;