Open paxblueribbon opened 2 months ago
Check out the protected route from the user routes for the example of how to do this through middleware:
router.get('/protected', passport.authenticate('jwt', { session: false }), function(req, res) { res.status(200).json({ msg: 'Congrats! You are seeing this because you are authorized.'}); });
Don't protect the create-admin route until a default admin is being created on db start