Skip to content

Instantly share code, notes, and snippets.

@animify
Created June 24, 2017 21:01
Show Gist options
  • Save animify/4fe39c9a975f1ca9f406aa841db48f79 to your computer and use it in GitHub Desktop.
Save animify/4fe39c9a975f1ca9f406aa841db48f79 to your computer and use it in GitHub Desktop.
const express = require('express')
const router = express.Router()
const auth = require('../auth')
router.use('/login/callback/github',
auth.authenticate('github', { failureRedirect: '/' }),
function(req, res) {
res.redirect('/')
});
router.get('/login/github', auth.authenticate('github'))
router.use('/login/callback/twitter',
auth.authenticate('twitter', { failureRedirect: '/' }),
function(req, res) {
res.redirect('/')
});
router.get('/login/twitter', auth.authenticate('twitter'))
module.exports = router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment