Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added one time phone verification using Firebase auth, as described in Issue #2013.
Changes include:
Flow diagram and implementation details here:
Additional changes made on on firebase console (dev):
Phone number: +1 650-555-1234
Verification code: 123456
Checklist
firestore.indexes.json(Please do not only create indexes through the Firebase Web UI, even though the error messages may reccommend it - indexes created this way may be obliterated by subsequent deploys)Steps to test
Can test using the emulator, when run yarn dev:up
Step 1:
Start local environment by running yarn dev:up
Create a new user by going through the sign up process on the local site
(usually http://localhost:3000/)
Step 2:
Open the firebase emulator > firestore.
(usually http://localhost:3010/firestore/)
Find the profile of the user you added.
[Can do this by going to profiles. Filter for field: fullName. Should be only a few documents. Click through to find the right one. Notice there is no “phoneVerified” field. Leave this tab open in your browser. After we do the verification, we’ll confirm here that there is now “phoneVerified” field set to true.
Step 3:
Back pin the local MAPLE site, navigate to the edit profile page by clicking the dropdown in the top right with the person icon.
There should now be a “Get Verified” button on the right
Click it.
A “Verify your phone number” modal should pop up.
Enter 650-555-1234
Search in your TERMINAL for
To verify the phone number +16505551234, use the code
The pop-up should have changed to now expect a verification code. Enter the code found in your terminal log.
Step 4:
The popup should have disappeared.
Confirm that the button on the right in the Edit profile page has been removed and now there is static text that says “Verified User”
Step 5:
Back in the firebase emulator, firestorm page, confirm that the profile document for your user now has ““phoneVerified: true”
Can also look at firebase emulator > Authentication and see that “provider” column for the expected user now shows both email and phone
Step 6:
TESTING invalid number:
Log out and create a new user.
Go to Edit Profile and click Get Verified
Try entering a phone number that is too short.
Confirm that you see the error message "Please enter a valid phone number”
Repeat with a phone number that is
-too long
-starts with a 1
Step 7:
TESTING phone number already in use.
Log out and create a new user.
Go to Edit Profile and click Get Verified
Enter the same phone number you used for the already verified account and enter the code given in your terminal (as in Step 3)
Confirm that you see the error message "This phone number is already linked to another account."