Skip to content

Refactor the way UserCredentials work in anticipation of mudularization #3489

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 5 commits into from
Jul 28, 2020

Conversation

sam-gc
Copy link
Contributor

@sam-gc sam-gc commented Jul 27, 2020

Basically:
Instead of interpreting the result of the IdTokenResponse as soon as it comes in, we delay that until the user directly requests it.

Before:

const userCred = await signInWithPopup(...);
const accessToken = userCred.credential.accessToken;

After:

const userCred = await signInWithPopup(...);
const credential = GoogleAuthProvider.credentialFromResult(userCred);
const accessToken = credential.accessToken;

This saves pulling in at least four different unnecessary classes

@changeset-bot
Copy link

changeset-bot bot commented Jul 27, 2020

💥 No Changeset

Latest commit: e1ce16f

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 27, 2020

Binary Size Report

Affected SDKs

No changes between base commit (e2efd27) and head commit (af23e80).

Test Logs

@avolkovi avolkovi assigned sam-gc and unassigned avolkovi Jul 28, 2020
@sam-gc sam-gc merged commit 7bb2f48 into auth-next Jul 28, 2020
@sam-gc sam-gc deleted the samgho/provider-modularization branch July 28, 2020 19:33
avolkovi pushed a commit that referenced this pull request Aug 6, 2020
…on (#3489)

* Refactor the way UserCredentials work in anticipation of mudularization

* Formatting

* PR feedback

* Linter fixes

* Formatting
avolkovi pushed a commit that referenced this pull request Aug 10, 2020
…on (#3489)

* Refactor the way UserCredentials work in anticipation of mudularization

* Formatting

* PR feedback

* Linter fixes

* Formatting
@firebase firebase locked and limited conversation to collaborators Aug 28, 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