You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: firebase-get-to-know-flutter/supplemental/part_01/README.md
+14-64Lines changed: 14 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,11 @@ Before we write any code, we need to configure our applications for Firebase MFA
14
14
15
15
### Android
16
16
17
-
For Android, you will want to register your SHA-256 certificate fingerprint in the console. If you are working with the default android signing key, you can find that fingerprint through the keytool command using :
17
+
For Android, you will want to register your SHA-256 certificate fingerprint in the console. If you are working with the default android signing key, you can find that fingerprint through the gradlew command using :
More information about signing keys can be found in this resource:
@@ -36,87 +37,36 @@ Once you have this value, you will want to open your project in XCode and go to
36
37
37
38
## Code
38
39
39
-
The first thing that we would want to do is to update the `ApplicationState` class at the bottom of the `main.dart` file. In this class we want to add a check on whether the user has verified their email address as users cannot start to enroll in MFA until they have a verified email address. The changes we would want to make would look like:
The problem though is that this check only runs after a user has logged in, and does not run when a user may do things like check the profile screen or do an out of band verification of their email address. To reload a user after they may have done an out of band email verification, we would want to add the following method to the `ApplicationState` class.
Now that we are able to check the verified email state, we would want to ensure that the user is able to get a verification email from Firebase. To add in an automatic verification email to be sent on user creation, add the following to the sign-in route of your applicaiton.
Next, we would want to provide a way for the user to enroll in MFA after they have verified their email. They can visit their profile page which should contain information about their user account. In this page, they should know whether or not their email was verified and if their email was verified, show an enrollment option for MFA. This will require us to consume our application state and check whether or not the email was verified and if it was, show the MFA enrollment option. If it was not verified, a yellow banner will be shown instead. We add in an out of band verification button for verification of the email verification since to automatically redirect back to the application, we would need to integrate deep linking. We use a key to determine whether or not the state of this widget needs to be updated and redrawn.
0 commit comments