Guest User

Untitled

a guest
Jan 31st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. exports.register = functions.https.onRequest((request,response)=>{
  2.  
  3. if (request.method !== "POST") {
  4. response.status(400).send("what are you trying baby?");
  5. return 0;
  6. }
  7.  
  8. const email = request.body.email;
  9. const pass = request.body.pass;
  10.  
  11. admin.auth().createUser({
  12. email: email,
  13. emailVerified: true,
  14. password: pass,
  15. })
  16. .then(function(userRecord) {
  17. // See the UserRecord reference doc for the contents of userRecord.
  18. console.log("Conductor " + email + "Creado" );
  19. response.send({"uid":userRecord.uid});
  20. return 1;
  21. })
  22. .catch(function(error) {
  23. response.send("Error: "+error);
  24. console.log("Error creating new user:", error);
  25. return 1;
  26. });
  27.  
  28. return 1;
  29. });
Add Comment
Please, Sign In to add comment