diff --git a/lib/auth/router.v1.ts b/lib/auth/router.v1.ts index 81c9ea6..92cfc3d 100644 --- a/lib/auth/router.v1.ts +++ b/lib/auth/router.v1.ts @@ -21,4 +21,13 @@ router.post('/login', (req, res, next) => { }) })(req, res, next) }) + +router.get('/profile', passport.authenticate('local'), (req, res) => { + if (req.isAuthenticated()) { + res.status(200).json(req.user) + } else { + res.status(404) + } +}) + export default router