Created
November 16, 2017 19:42
-
-
Save calthoff/d66e4716f9754852f69071b15efb81b5 to your computer and use it in GitHub Desktop.
This file contains 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('/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