-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
verifyBeforeUpdateEmail
method (#741)
* Added verifyBeforeUpdateEmail method to web, iOS, Android. Updated documents to include the new method. * Updated README from wrong version to latest. * Handle success and failure callbacks for Java. Alphabetize iOS method ordering. Update version number. * Updated README definition for newEmail and added example. * Added result callback to method that handles errors and success * Fix prettier issues * EmptyResultCallback change * Added changeset * Update packages/authentication/src/definitions.ts --------- Co-authored-by: Robin Genz <[email protected]>
- Loading branch information
1 parent
2665fa9
commit 7af2032
Showing
9 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@capacitor-firebase/authentication': minor | ||
--- | ||
|
||
feat: add `verifyBeforeUpdateEmail` method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,6 +400,28 @@ const useEmulator = async () => { | |
port: 9099, | ||
}); | ||
}; | ||
|
||
const verifyBeforeUpdateEmail = async () => { | ||
const currentUser = await getCurrentUser(); | ||
if (!currentUser) { | ||
return; | ||
} | ||
await FirebaseAuthentication.verifyBeforeUpdateEmail({ | ||
newEmail: '[email protected]', | ||
actionCodeSettings: { | ||
url: 'https://www.example.com/[email protected]&cartId=123', | ||
iOS: { | ||
bundleId: 'com.example.ios' | ||
}, | ||
android: { | ||
packageName: 'com.example.android', | ||
installApp: true, | ||
minimumVersion: '12' | ||
}, | ||
handleCodeInApp: true | ||
} | ||
}); | ||
}; | ||
``` | ||
|
||
## API | ||
|
@@ -457,6 +479,7 @@ const useEmulator = async () => { | |
* [`signOut()`](#signout) | ||
* [`unlink(...)`](#unlink) | ||
* [`updateEmail(...)`](#updateemail) | ||
* [`verifyBeforeUpdateEmail(...)`](#verifyBeforeUpdateEmail) | ||
* [`updatePassword(...)`](#updatepassword) | ||
* [`updateProfile(...)`](#updateprofile) | ||
* [`useAppLanguage()`](#useapplanguage) | ||
|
@@ -1450,6 +1473,22 @@ Updates the email address of the currently signed in user. | |
|
||
-------------------- | ||
|
||
### verifyBeforeUpdateEmail(...) | ||
|
||
```typescript | ||
verifyBeforeUpdateEmail(options: VerifyBeforeUpdateEmailOptions) => Promise<void> | ||
``` | ||
|
||
Verifies the email before updating the email address of the currently signed in user. | ||
|
||
| Param | Type | | ||
| ------------- | ----------------------------------------------------------------- | | ||
| **`options`** | <code><a href="#verifybeforeupdateemailoptions">VerifyBeforeUpdateEmailOptions</a></code> | | ||
|
||
**Since:** 6.2.0 | ||
|
||
-------------------- | ||
|
||
|
||
### updatePassword(...) | ||
|
||
|
@@ -1953,6 +1992,14 @@ An interface covering the possible persistence mechanism types. | |
| **`newEmail`** | <code>string</code> | The new email address. | 0.2.2 | | ||
|
||
|
||
#### VerifyBeforeUpdateEmailOptions | ||
|
||
| Prop | Type | Description | Since | | ||
| -------------- | ------------------- | ---------------------- | ----- | | ||
| **`newEmail`** | <code>string</code> | The new email address to be verified before update. | 0.2.2 | | ||
| **`actionCodeSettings`** | <code><a href="#actioncodesettings">ActionCodeSettings</a></code> | Structure that contains the required continue/state URL with optional Android and iOS bundle identifiers. | 1.1.0 | | ||
|
||
|
||
#### UpdatePasswordOptions | ||
|
||
| Prop | Type | Description | Since | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters