Appearance
generateEmailVerificationLink()
generateEmailVerificationLink(
actionCodeSettings?):Promise<string>
Defined in: CloudFireAuth.ts:580
Generates the out of band email action link to verify the user's ownership of the specified email. The ActionCodeSettings object provided as an argument to this method defines whether the link is to be handled by a mobile app or browser along with additional state information to be passed in the deep link, etc.
Parameters
email
string
The email account to verify.
actionCodeSettings?
The action code settings. If specified, the state/continue URL is set as the "continueUrl" parameter in the email verification link. The default email verification landing page will use this to display a link to go back to the app if it is installed. If the actionCodeSettings is not specified, no URL is appended to the action URL. The state URL provided must belong to a domain that is whitelisted by the developer in the console. Otherwise an error is thrown. Mobile app redirects are only applicable if the developer configures and accepts the Firebase Dynamic Links terms of service. The Android package name and iOS bundle ID are respected only if they are configured in the same Firebase Auth project.
Returns
Promise<string>
A promise that resolves with the generated link.
Example
javascript
var actionCodeSettings = {
url: 'https://www.example.com/cart?email=user@example.com&cartId=123',
iOS: {
bundleId: 'com.example.ios'
},
android: {
packageName: 'com.example.android',
installApp: true,
minimumVersion: '12'
},
handleCodeInApp: true,
linkDomain: 'project-id.firebaseapp.com'
};
admin.auth()
.generateEmailVerificationLink('user@example.com', actionCodeSettings)
.then(function(link) {
// The link was successfully generated.
})
.catch(function(error) {
// Some error occurred, you can inspect the code: error.code
});