Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #34 from sfeast/changeEmail
Browse files Browse the repository at this point in the history
Adding new changeEmail function for password provider user accounts
  • Loading branch information
kevinpschaaf committed Feb 2, 2015
2 parents ce9d993 + 2a817a9 commit 477f871
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions firebase-login.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
/**
* Changes the password of a "password provider"-based user account.
*
* If the operation is successful, the `user-created` event is fired.
* If the operation is successful, the `password-changed` event is fired.
*
* If the operation fails, the `error` event is fired, with `e.detail`
* containing error information supplied from Firebase.
Expand All @@ -333,7 +333,7 @@
/**
* Sends a password reset email for a "password provider"-based user account.
*
* If the operation is successful, the `user-created` event is fired.
* If the operation is successful, the `password-reset` event is fired.
*
* If the operation fails, the `error` event is fired, with `e.detail`
* containing error information supplied from Firebase.
Expand All @@ -351,10 +351,37 @@
}.bind(this));
},

/**
* Changes the email of a "password provider"-based user account.
*
* If the operation is successful, the `email-changed` event is fired.
*
* If the operation fails, the `error` event is fired, with `e.detail`
* containing error information supplied from Firebase.
*
* @method changeEmail
* @param {string} oldEmail
* @param {string} newEmail
* @param {string} Password
*/
changeEmail: function(oldEmail, newEmail, password) {
this.ref.changeEmail({
oldEmail: oldEmail,
newEmail: newEmail,
password: password
}, function(error) {
if (!error) {
this.fire('email-changed');
} else {
this.fire('error', error);
}
}.bind(this));
},

/**
* Removes a "password provider"-based user account.
*
* If the operation is successful, the `user-created` event is fired.
* If the operation is successful, the `user-removed` event is fired.
*
* If the operation fails, the `error` event is fired, with `e.detail`
* containing error information supplied from Firebase.
Expand Down

0 comments on commit 477f871

Please sign in to comment.