nice auth flow working with verification and stuff with token
This commit is contained in:
@@ -27,11 +27,19 @@ export default function getUserRoutes() {
|
||||
|
||||
router.get("/login", login);
|
||||
|
||||
router.get("/authCheck", authCheck);
|
||||
router.get("/authcheck", authCheck, handleAuthCheck);
|
||||
|
||||
return router;
|
||||
}
|
||||
|
||||
async function handleAuthCheck(req: Request, res: Response) {
|
||||
try {
|
||||
res.status(200).send();
|
||||
} catch (error) {
|
||||
res.status(401).send();
|
||||
}
|
||||
}
|
||||
|
||||
/** Create user if doesn't exist
|
||||
* Returns jwt token for client and user details
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user