Advertisement
Guest User

Untitled

a guest
Mar 11th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. $registerButton.click(function() {
  2. var email = $emailInput.val();
  3. var password = $passInput.val();
  4. ref.createUser({
  5. email: email,
  6. password: password
  7. },
  8. function(error, userData) {
  9. if (error) {
  10. switch (error.code) {
  11. case "EMAIL_TAKEN":
  12. console.log("The new user account cannot be created because the email is already in use.");
  13. break;
  14. case "INVALID_EMAIL":
  15. console.log("The specified email is not a valid email.");
  16. break;
  17. default:
  18. console.log("Error creating user:", error);
  19. }
  20. } else {
  21. // Email en password: worden meegegeven als objecten
  22. login({email:email,password: password});
  23. console.log("Successfully created user account with uid:", userData.uid);
  24. }
  25.  
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement