Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 604af98

Browse files
Couldn't find Manage User functions #1080 (added Web API support for 'updatePassword')
1 parent f89c6be commit 604af98

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

docs/AUTHENTICATION.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,17 @@ This may not work on an (Android) simulator. See #463.
379379
);
380380
```
381381

382-
#### Changing a password
382+
#### Updating a password
383+
384+
> The method name was changed in 8.0.0 from `changePassword` to `updatePassword` to better align with the Web API.
385+
383386
Note that changing a password may fail if your login for this `email` was too long ago (per Firebase's standards, whatever they are).
384387

388+
<details>
389+
<summary>Native API</summary>
390+
385391
```js
386-
firebase.changePassword({
387-
email: 'useraccount@provider.com',
388-
oldPassword: 'myOldPassword',
392+
firebase.updatePassword({
389393
newPassword: 'myNewPassword'
390394
}).then(
391395
function () {
@@ -396,6 +400,17 @@ Note that changing a password may fail if your login for this `email` was too lo
396400
}
397401
);
398402
```
403+
</details>
404+
405+
<details>
406+
<summary>Web API</summary>
407+
408+
```typescript
409+
firebaseWebApi.auth().updatePassword('new-password')
410+
.then(() => console.log("Password updated"))
411+
.catch(error => console.log("Error creating user: " + error));
412+
```
413+
</details>
399414

400415
### Phone Verification
401416
* Don't forget to enable Phone login in your firebase instance.

0 commit comments

Comments
 (0)