Skip to content

Instantly share code, notes, and snippets.

@tksilicon
Created May 10, 2020 09:11
Show Gist options
  • Save tksilicon/a7173b585ed6a422227fbf1996f6c51d to your computer and use it in GitHub Desktop.
Save tksilicon/a7173b585ed6a422227fbf1996f6c51d to your computer and use it in GitHub Desktop.
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