Created
June 6, 2018 09:54
-
-
Save YonathanMeguira/b1efa74809dcb34b30967cfd4360ed06 to your computer and use it in GitHub Desktop.
money bot - check user
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
| const Firebase = require("./firebase.init"); | |
| const checkUser = (UID, res) => { | |
| Firebase.FireDB.ref(UID) | |
| .once("value") | |
| .then(snapshot => { | |
| const user = snapshot.val() || "undefined"; | |
| if (user !== "undefined") { | |
| res.send({ redirect_to_blocks: ["offre"] }); | |
| } else { | |
| res.send({ redirect_to_blocks: ["new_user"] }); | |
| } | |
| }); | |
| }; | |
| module.exports = { checkUser }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment