Skip to content
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

Implement beforeAuthStateChanged() Auth middleware function #6151

Merged
merged 6 commits into from
May 5, 2022

Conversation

hsubox76
Copy link
Contributor

@changeset-bot
Copy link

changeset-bot bot commented Apr 13, 2022

🦋 Changeset detected

Latest commit: b8fb38a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/auth Minor
@firebase/auth-compat Patch
firebase Patch

Not sure what this means? Click here to learn what changesets are.

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

@hsubox76 hsubox76 marked this pull request as draft April 13, 2022 21:48
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 13, 2022

Size Report 1

Affected Products

  • @firebase/auth-compat

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    browser20.1 kB20.2 kB+57 B (+0.3%)
    esm526.9 kB27.0 kB+57 B (+0.2%)
    main29.5 kB29.6 kB+68 B (+0.2%)
    module20.1 kB20.2 kB+57 B (+0.3%)
  • @firebase/auth/cordova

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    browser180 kB183 kB+3.00 kB (+1.7%)
    module180 kB183 kB+3.00 kB (+1.7%)
  • @firebase/auth/internal

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    browser164 kB166 kB+2.07 kB (+1.3%)
    esm5213 kB216 kB+3.08 kB (+1.4%)
    main180 kB183 kB+3.31 kB (+1.8%)
    module164 kB166 kB+2.07 kB (+1.3%)
  • @firebase/auth/react-native

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    browser165 kB168 kB+3.02 kB (+1.8%)
    module165 kB168 kB+3.02 kB (+1.8%)
  • @firebase/database

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    browser247 kB248 kB+612 B (+0.2%)
    esm5275 kB276 kB+694 B (+0.3%)
    main280 kB281 kB+878 B (+0.3%)
    module247 kB248 kB+612 B (+0.2%)
  • @firebase/database-compat

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    browser17.9 kB18.0 kB+99 B (+0.6%)
    esm521.0 kB21.1 kB+99 B (+0.5%)
    main21.7 kB21.8 kB+84 B (+0.4%)
    module17.9 kB18.0 kB+99 B (+0.6%)
  • @firebase/database-compat/standalone

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    main369 kB370 kB+878 B (+0.2%)
  • @firebase/firestore

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    browser253 kB253 kB+212 B (+0.1%)
    esm5314 kB314 kB+203 B (+0.1%)
    main505 kB506 kB+378 B (+0.1%)
    module253 kB253 kB+212 B (+0.1%)
    react-native253 kB253 kB+212 B (+0.1%)
  • @firebase/firestore-lite

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    browser73.3 kB73.4 kB+189 B (+0.3%)
    esm586.7 kB86.9 kB+181 B (+0.2%)
    main126 kB126 kB+362 B (+0.3%)
    module73.3 kB73.4 kB+189 B (+0.3%)
    react-native73.5 kB73.6 kB+189 B (+0.3%)
  • bundle

    17 size changes

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    auth (Anonymous)65.0 kB66.0 kB+997 B (+1.5%)
    auth (EmailAndPassword)69.1 kB70.1 kB+997 B (+1.4%)
    auth (GoogleFBTwitterGitHubPopup)88.9 kB89.9 kB+1.07 kB (+1.2%)
    auth (GooglePopup)88.6 kB89.7 kB+1.07 kB (+1.2%)
    auth (GoogleRedirect)88.8 kB89.9 kB+1.07 kB (+1.2%)
    auth (Phone)75.1 kB76.1 kB+997 B (+1.3%)
    database (Append to a list of data)145 kB145 kB+150 B (+0.1%)
    database (Filtering data)144 kB144 kB+150 B (+0.1%)
    database (Listen for child events)160 kB160 kB+150 B (+0.1%)
    database (Listen for value events + Detach listeners)160 kB160 kB+150 B (+0.1%)
    database (Listen for value events)160 kB160 kB+150 B (+0.1%)
    database (Read data once)151 kB152 kB+150 B (+0.1%)
    database (Save data as transactions)162 kB162 kB+150 B (+0.1%)
    database (Sort data)146 kB146 kB+150 B (+0.1%)
    database (Write data)144 kB144 kB+150 B (+0.1%)
    firestore (Transaction)178 kB178 kB+214 B (+0.1%)
    firestore-lite (Transaction)72.7 kB72.9 kB+191 B (+0.3%)

  • firebase

    TypeBase (5ce0676)Merge (8dcbd88)Diff
    firebase-auth-compat.js123 kB124 kB+1.15 kB (+0.9%)
    firebase-auth-cordova.js463 kB471 kB+7.96 kB (+1.7%)
    firebase-auth-react-native.js487 kB495 kB+7.97 kB (+1.6%)
    firebase-auth.js412 kB417 kB+5.39 kB (+1.3%)
    firebase-compat.js781 kB783 kB+1.80 kB (+0.2%)
    firebase-database-compat.js165 kB166 kB+436 B (+0.3%)
    firebase-database.js603 kB604 kB+1.22 kB (+0.2%)
    firebase-firestore-compat.js305 kB305 kB+209 B (+0.1%)
    firebase-firestore-lite.js250 kB251 kB+846 B (+0.3%)
    firebase-firestore.js824 kB825 kB+876 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/GPkR6MlwZs.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 13, 2022

Size Analysis Report 1

This report is too large (268,808 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/A6pWUpBabn.html

hsubox76 and others added 3 commits May 4, 2022 14:18
…6161)

* Add integration tests for auth middleware

* Webdriver tests

* Lint

* Formatting
* Fix redirect middleware

* Fix compat tests

* Formatting

* PR feedback
@@ -254,6 +254,16 @@ export interface Auth {
error?: ErrorFn,
completed?: CompleteFn
): Unsubscribe;
/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@egilmorez Can we get a review of the comments here? They will go into the reference docs.

Copy link
Contributor

@egilmorez egilmorez left a comment

Choose a reason for hiding this comment

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

LG! Small nit: we avoid future tense whenever present suffices. Thanks!

packages/auth/src/model/public_types.ts Outdated Show resolved Hide resolved
hsubox76 and others added 3 commits May 5, 2022 09:27
* Add onAbort and refactor middleware

* Update packages/auth/src/core/auth/middleware.test.ts

Co-authored-by: Yuchen Shi <yuchenshi@google.com>

* Add beforeAuthStateChanged fn export (#6222)

* Make some doc comment changes (#6229)

Co-authored-by: Yuchen Shi <yuchenshi@google.com>
Co-authored-by: James Daniels <jamesdaniels@google.com>
Co-authored-by: Christina Holland <hsubox@gmail.com>
Copy link
Contributor

@dwyfrequency dwyfrequency left a comment

Choose a reason for hiding this comment

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

LGTM

@sam-gc sam-gc marked this pull request as ready for review May 5, 2022 21:50
@hsubox76 hsubox76 merged commit 1ac3c9d into master May 5, 2022
@hsubox76 hsubox76 deleted the auth-middleware branch May 5, 2022 21:59
@google-oss-bot google-oss-bot mentioned this pull request May 5, 2022
@firebase firebase locked and limited conversation to collaborators Jun 5, 2022
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.

None yet

5 participants