Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.register = functions.https.onRequest((request,response)=>{
- if (request.method !== "POST") {
- response.status(400).send("what are you trying baby?");
- return 0;
- }
- const email = request.body.email;
- const pass = request.body.pass;
- admin.auth().createUser({
- email: email,
- emailVerified: true,
- password: pass,
- })
- .then(function(userRecord) {
- // See the UserRecord reference doc for the contents of userRecord.
- console.log("Conductor " + email + "Creado" );
- response.send({"uid":userRecord.uid});
- return 1;
- })
- .catch(function(error) {
- response.send("Error: "+error);
- console.log("Error creating new user:", error);
- return 1;
- });
- return 1;
- });
Add Comment
Please, Sign In to add comment