email-provider | Detect email provider by address | Email library
kandi X-RAY | email-provider Summary
kandi X-RAY | email-provider Summary
Detect Provider's Service name by email address.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of email-provider
email-provider Key Features
email-provider Examples and Code Snippets
Community Discussions
Trending Discussions on email-provider
QUESTION
Currently, I have four different provider-methods to sign-in/create an account in my app:
- Email and Password
- Microsoft
When the user logs in the first time via one of the providers (or creates an account via email and password) I automatically create a user-document with additional info in cloud-firestore. Here comes the problem with one of my providers (email and password):
When the user creates an account with provider "email and password" he can choose whatever email he/she likes and therefore could also use a Google or Microsoft email and provide wrong additional info (wrong name etc.). This wrong information is then stored in the user-document that I create ONCE the user creates his account.
If the above user then not verifies his email and logs in via Google or Microsoft provider, the old "email and password" provider gets overridden BUT NOT THE WRONG user-document I created before.
My question is: Is there a way to observer, or know, that a provider was overridden by another provider and therefore also override the wrong user-document?
General Code ...ANSWER
Answered 2021-Oct-10 at 13:50I think you may be looking for the fetchSignInMethodsForEmail
function. You can pass this the email of the user, and then check if the email is already in use with the email+password provider (in which case you need to clean up that document).
QUESTION
I read some other posts about this topic but couldn't finally figure out how to accomplish this.
I want to send the email-verification email normally send from firebase itself from my own email-provider (like mailjet e. g.) The reason is that I want to customize the email text etc.
I also read about creating a custom email handler which I would do too. But this just handles the action that happens when the user clicks on the link in the email.
At the moment I call this from my flutter app after the users sign up:
...ANSWER
Answered 2021-Feb-24 at 12:33You need to generate and send the email via a backend, by using the Admin SDK. The easiest is to use a Cloud Function, from which you use the Mailjet NodeJS API wrapper.
So, in the Cloud Function, you need to:
- Call the
generateEmailVerificationLink()
method of the Admin SDK, which returns a link - Generate an email containing this link
- Send the email to the user (see the Mailjet NodeJS API wrapper documentation)
The first steps are detailed here in the doc.
In order to customize the URL of the verification link (e.g. you want to redirect to https://www.myrapp.com/emailVerifyScreen) you need to change the base URL as shown in the below image ("Customize action URL"). Also explained here in the doc.
Then, when the user clicks on the link in the email he/she has received, you need to do what is explained in the doc you referred to in your question: Create custom email action handlers. See the point #4 "Handle email address verification by calling applyActionCode".
Concretely, in the page of your app https://www.myrapp.com/emailVerifyScreen, you get the query string values from the URL (e.g. var actionCode = getParameterByName('oobCode');
) and you use these values to call the applyActionCode(actionCode)
method. When the promise returned by this method is fullfilled, you know that the email has been verified.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install email-provider
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page