-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(auth): include phoneNumber from PhoneMultiFactorInfo #7565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mikehardy
merged 5 commits into
invertase:main
from
mnahkies:mn/feat/marshall-phone-number
May 20, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7656a9c
feat: include phoneNumber from PhoneMultiFactorInfo
mnahkies 938f2b1
fix(auth, android): change error code for invalid multi-factor sessio…
mikehardy a9b1fcc
chore(auth, ios): fix DLog formatting
mikehardy b815ea3
chore(auth, ios): add dev logging in multi-factor area
mikehardy 3e397a4
fix(auth, ios): reject multi-factor API call if session not found
mikehardy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -547,6 +547,7 @@ describe('multi-factor modular', function () { | |
this.skip(); | ||
} | ||
const { phoneNumber, email, password } = await createUserWithMultiFactor(); | ||
const maskedNumber = '+********' + phoneNumber.substring(phoneNumber.length - 4); | ||
|
||
const { signInWithEmailAndPassword, getAuth, getMultiFactorResolver } = authModular; | ||
|
||
|
@@ -562,6 +563,9 @@ describe('multi-factor modular', function () { | |
multiFactorResolver.should.be.an.Object(); | ||
multiFactorResolver.hints.should.be.an.Array(); | ||
multiFactorResolver.hints.length.should.equal(1); | ||
multiFactorResolver.hints[0].factorId.should.equal('phone'); | ||
multiFactorResolver.hints[0].phoneNumber.should.equal(maskedNumber); | ||
|
||
multiFactorResolver.session.should.be.a.String(); | ||
|
||
const verificationId = await new firebase.auth.PhoneAuthProvider( | ||
|
@@ -575,7 +579,6 @@ describe('multi-factor modular', function () { | |
let verificationCode = await getLastSmsCode(phoneNumber); | ||
if (verificationCode == null) { | ||
// iOS simulator uses a masked phone number | ||
const maskedNumber = '+********' + phoneNumber.substring(phoneNumber.length - 4); | ||
verificationCode = await getLastSmsCode(maskedNumber); | ||
} | ||
const phoneAuthCredential = new firebase.auth.PhoneAuthProvider.credential( | ||
|
@@ -591,6 +594,8 @@ describe('multi-factor modular', function () { | |
user.email.should.equal('[email protected]'); | ||
user.multiFactor.should.be.an.Object(); | ||
user.multiFactor.enrolledFactors.length.should.equal(1); | ||
user.multiFactor.enrolledFactors[0].factorId.should.equal('phone'); | ||
user.multiFactor.enrolledFactors[0].phoneNumber.should.equal(phoneNumber); | ||
return Promise.resolve(); | ||
}) | ||
.catch(e => { | ||
|
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.