Skip to content

Instantly share code, notes, and snippets.

@calthoff
Created November 16, 2017 19:42
Show Gist options
  • Save calthoff/d66e4716f9754852f69071b15efb81b5 to your computer and use it in GitHub Desktop.
Save calthoff/d66e4716f9754852f69071b15efb81b5 to your computer and use it in GitHub Desktop.
router.post('/login', function (req, res, next) {
var uid = req.body.uid // query
var displayName = req.body.display_name
var photoURL = req.body.photo_url
var email = req.body.email
var accessToken = req.body.authToken
if (uid != null) {
req.session.uid = uid
req.session.accessToken = accessToken
FirebaseUtils.createUser(uid, displayName, photoURL, email, function (userObject) {
if (userObject.pods == null) {
res.redirect('/influencer_select')
// if (userObject.stripe_id == null) {
// res.redirect('/stripe_connect')
} else {
res.redirect('/')
}
})
} else {
res.redirect('/logout')
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment