Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .post('/login', (ctx) => {
- return passport.authenticate('local', (err, user) => {
- if (!user) {
- ctx.throw(401, err);
- } else {
- ctx.body = user;
- return ctx.login(user);
- }
- })(ctx);
- })
- .get('/auth/facebook', passport.authenticate('facebook'))
- .get(
- '/auth/facebook/callback',
- passport.authenticate('facebook', {
- successRedirect: '/facebook/success/',
- failureRedirect: '/',
- }),
- )
- );
Add Comment
Please, Sign In to add comment