Created
May 10, 2020 09:11
-
-
Save tksilicon/a7173b585ed6a422227fbf1996f6c51d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post( | |
'/customers', | |
check('email').isEmail(), | |
CustomerController.create | |
); | |
router.post( | |
'/customers/login', | |
passport.authenticate('login'), | |
[ | |
// Check validity | |
check('email', 'Invalid email').isEmail(), | |
check('password') | |
.not() | |
.isEmpty(), | |
], | |
CustomerController.login | |
); | |
router.post( | |
'/customers/facebook', | |
passport.authenticate('facebook-token'), | |
CustomerController.loginfacebook | |
); | |
router.get('/customer', passport.authenticate('jwt'), CustomerController.getCustomerProfile); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment