Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ If you need a session the browser cannot read, use Firebase's [session cookies](

#### `beforeAuthStateChanged` from `firebase/auth`

One import in the code above is deliberately different from the rest of this guide. `beforeAuthStateChanged` comes from `firebase/auth` rather than `@angular/fire/auth`. AngularFire's version keeps the app marked as busy until its callback first runs, and this callback only runs when someone signs in or out.

Importing it from `@angular/fire/auth` makes `ng build` hang during route extraction and fail with a timeout. That is a bug on our side, tracked in [#3748](https://github.com/angular/angularfire/issues/3748). Once the fix lands, this can be imported from `@angular/fire/auth` like everything else.
One import in the code above is deliberately different from the rest of this guide. `beforeAuthStateChanged` comes from `firebase/auth` rather than `@angular/fire/auth`. In AngularFire 21.0.0-rc.1 and earlier, AngularFire's version keeps the app marked as busy until its callback first runs, and this callback only runs when someone signs in or out ([#3748](https://github.com/angular/angularfire/issues/3748)).

### 3. Pass the cookie into the render

Expand Down
2 changes: 1 addition & 1 deletion src/auth/firebase.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tools/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ ${exportedZoneWrappedFns}
indexedDBLocalPersistence: null,
prodErrorMap: null,
multiFactor: null,
// Its callback fires only on a sign-in or sign-out, so blocking would keep `ApplicationRef.isStable` false.
beforeAuthStateChanged: { blockUntilFirst: false },
linkWithCredential: { logLevel: LogLevel.VERBOSE },
linkWithPhoneNumber: { logLevel: LogLevel.VERBOSE },
linkWithPopup: { logLevel: LogLevel.VERBOSE },
Expand Down
Loading