Skip to content

Cleanup demo code & get it working with MFA flows #3380

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
merged 1 commit into from
Jul 9, 2020

Conversation

avolkovi
Copy link
Contributor

@avolkovi avolkovi commented Jul 9, 2020

  • lint the demo
  • fix some error handling code
  • fix verifyPhoneNumber when called with MFA context
  • add to/fromJSON to EmailAuthCredential

@avolkovi avolkovi requested a review from sam-gc July 9, 2020 19:13
@changeset-bot
Copy link

changeset-bot bot commented Jul 9, 2020

💥 No Changeset

Latest commit: 2c36f93

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 9, 2020

Binary Size Report

Affected SDKs

No changes between base commit (49a7240) and head commit (5d508e2).

Test Logs

@avolkovi avolkovi force-pushed the avolkovi/auth-next-demo branch from 8741896 to 47034e9 Compare July 9, 2020 19:59
@@ -54,6 +55,7 @@ export const enum AuthErrorCode {
INVALID_EMAIL = 'invalid-email',
INVALID_IDP_RESPONSE = 'invalid-credential',
INVALID_MESSAGE_PAYLOAD = 'invalid-message-payload',
INVALID_MFA_SESSION = 'invalid-multi-factor-session',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -125,7 +125,8 @@ export async function _performFetchWithErrorHandling<V>(
return response.json();
} else {
const json: JsonError = await response.json();
const authError = errorMap[json.error.message];
const serverErrorCode = json.error.message.split(' : ')[0] as ServerError;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using a regex to make this potentially-less-brittle
/\s*:/ should do it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the existing SDK does it a bit different... https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/rpchandler.js#L2916 they use everything to the right of the colon as the message, overriding whatever is in the error map

@@ -2175,6 +2175,24 @@
dependencies:
slash "^3.0.0"

"@rollup/plugin-strip@^1.3.2":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes to yarn.lock necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they're specific to our branch, i reverted the yarn.lock when I rebased against master yesterday

- lint the demo
- fix some error handling code
- fix verifyPhoneNumber when called with MFA context
- add to/fromJSON to EmailAuthCredential
@avolkovi avolkovi force-pushed the avolkovi/auth-next-demo branch from 47034e9 to 2c36f93 Compare July 9, 2020 21:33
@avolkovi avolkovi merged commit 1e25900 into auth-next Jul 9, 2020
@avolkovi avolkovi deleted the avolkovi/auth-next-demo branch July 9, 2020 21:46
avolkovi added a commit that referenced this pull request Aug 6, 2020
- lint the demo
- fix some error handling code
- fix verifyPhoneNumber when called with MFA context
- add to/fromJSON to EmailAuthCredential
@firebase firebase locked and limited conversation to collaborators Aug 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants