-
Notifications
You must be signed in to change notification settings - Fork 944
Register auth with the app component. Add the getAuth() methods for each platform #3637
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
Conversation
💥 No ChangesetLatest commit: 107de24 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 changesetsWhen 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 |
Binary Size ReportAffected SDKsNo changes between base commit (55d3c26) and head commit (487c6f1). Test Logs
|
export function getAuth(app?: FirebaseApp): Auth { | ||
return initializeAuth(app, { | ||
popupRedirectResolver: browserPopupRedirectResolver, | ||
persistence: [indexedDBLocalPersistence, browserLocalPersistence] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't we do the same style of fallback for workers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "fallback" is doing different things. Here, it's saying "check these persistences in this order," whereas for workers, it's literally checking to see if it's available (if you tried to pass indexedDB into it when it wasn't available, the instantiation would just error out)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't auth fallback to memory persistence when indexedDB is not available. Why is it different for workers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently it would error. It probably shouldn't but we need to clarify that separately. For now I'd like to move ahead and deal with that issue in a separate PR. I'm tracking this in b/165376704
export function getAuth(app?: FirebaseApp): Auth { | ||
return initializeAuth(app, { | ||
popupRedirectResolver: browserPopupRedirectResolver, | ||
persistence: [indexedDBLocalPersistence, browserLocalPersistence] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't auth fallback to memory persistence when indexedDB is not available. Why is it different for workers?
@@ -54,6 +54,8 @@ export function signOut(auth: externs.Auth): Promise<void> { | |||
return auth.signOut(); | |||
} | |||
|
|||
export { initializeAuth } from './auth/initialize'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the entry point for it? @firebase/auth/core
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No entry point for it, it's only used as a building block for the other entry points
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializeAuth
is a public API in the original proposal, which allows people to configure things, e.g. persistence and resolvers. Has that changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It's just the way our exports go:
src/core/index.ts
re-exports all of the things in core
src/index.ts
just does export * from './core'
;
index.ts
does export * from './src';
as well as the browser-specific APIs
…ach platform (#3637) * Register auth with the app component. Add the getAuth() methods for each platform * Add getAuth for webworker build * Formatting * Make firebase auth implement _FirebaseService interface * Formatting * Fix tests * Formatting * PR feedback * Formatting * PR feedback * Formatting
No description provided.