Skip to content

Instantly share code, notes, and snippets.

@YonathanMeguira
Created June 6, 2018 09:54
Show Gist options
  • Select an option

  • Save YonathanMeguira/b1efa74809dcb34b30967cfd4360ed06 to your computer and use it in GitHub Desktop.

Select an option

Save YonathanMeguira/b1efa74809dcb34b30967cfd4360ed06 to your computer and use it in GitHub Desktop.
money bot - check user
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