Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
chore: add profile route (MEL-12) (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
keinsell committed Nov 27, 2021
1 parent 4b22754 commit de8ffa5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/auth/router.v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit de8ffa5

Please sign in to comment.