|
306 | 306 | /** |
307 | 307 | * Changes the password of a "password provider"-based user account. |
308 | 308 | * |
309 | | - * If the operation is successful, the `user-created` event is fired. |
| 309 | + * If the operation is successful, the `password-changed` event is fired. |
310 | 310 | * |
311 | 311 | * If the operation fails, the `error` event is fired, with `e.detail` |
312 | 312 | * containing error information supplied from Firebase. |
|
333 | 333 | /** |
334 | 334 | * Sends a password reset email for a "password provider"-based user account. |
335 | 335 | * |
336 | | - * If the operation is successful, the `user-created` event is fired. |
| 336 | + * If the operation is successful, the `password-reset` event is fired. |
337 | 337 | * |
338 | 338 | * If the operation fails, the `error` event is fired, with `e.detail` |
339 | 339 | * containing error information supplied from Firebase. |
|
351 | 351 | }.bind(this)); |
352 | 352 | }, |
353 | 353 |
|
| 354 | + /** |
| 355 | + * Changes the email of a "password provider"-based user account. |
| 356 | + * |
| 357 | + * If the operation is successful, the `email-changed` event is fired. |
| 358 | + * |
| 359 | + * If the operation fails, the `error` event is fired, with `e.detail` |
| 360 | + * containing error information supplied from Firebase. |
| 361 | + * |
| 362 | + * @method changeEmail |
| 363 | + * @param {string} oldEmail |
| 364 | + * @param {string} newEmail |
| 365 | + * @param {string} Password |
| 366 | + */ |
| 367 | + changeEmail: function(oldEmail, newEmail, password) { |
| 368 | + this.ref.changeEmail({ |
| 369 | + oldEmail: oldEmail, |
| 370 | + newEmail: newEmail, |
| 371 | + password: password |
| 372 | + }, function(error) { |
| 373 | + if (!error) { |
| 374 | + this.fire('email-changed'); |
| 375 | + } else { |
| 376 | + this.fire('error', error); |
| 377 | + } |
| 378 | + }.bind(this)); |
| 379 | + }, |
| 380 | + |
354 | 381 | /** |
355 | 382 | * Removes a "password provider"-based user account. |
356 | 383 | * |
357 | | - * If the operation is successful, the `user-created` event is fired. |
| 384 | + * If the operation is successful, the `user-removed` event is fired. |
358 | 385 | * |
359 | 386 | * If the operation fails, the `error` event is fired, with `e.detail` |
360 | 387 | * containing error information supplied from Firebase. |
|
0 commit comments