Created
January 24, 2015 11:38
-
-
Save adamrneary/161d35bcd153dd2e42c0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| exports.firebase = function (req, res) { | |
| if(req.user) { | |
| var generator = new FirebaseTokenGenerator(process.env.FIREBASE_SECRET); | |
| var token = generator.createToken({uid: req.user.id}); | |
| res.send(token); | |
| } else { | |
| res.send(401, {error: "You must be logged in to perform this operation"}); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment