-
Notifications
You must be signed in to change notification settings - Fork 949
Maintain persistence for firebaseToken in AuthImpl object #9119
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
base: gcip-byociam-web
Are you sure you want to change the base?
Conversation
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
if (firebaseToken) { | ||
await this.assertedPersistence.setFirebaseToken(firebaseToken); | ||
} else { | ||
await this.assertedPersistence.removeFirebaseToken(); |
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.
You will have to do same for signOut as well right?
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.
Correct. I plan to create a separate CL for signOut logic. Please let me know if you see any concerns.
@@ -280,6 +280,12 @@ export interface Auth { | |||
callback: (user: User | null) => void | Promise<void>, | |||
onAbort?: () => void | |||
): Unsubscribe; | |||
|
|||
onFirebaseTokenChanged( |
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.
q: When do we call onFirebaseTokenChanged
?
- Please add jsdoc
- Do we need to implement a onFirebaseTokenChanged function in packages/auth/src/core/index.ts ?
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.
Hey, I onFirebaseTokenChanged
is a callback method that is triggered when firebase token is updated i.e. during the following scenarios -
- On App initialization when FirebaseToken is fetched from the persistence.
- When a getToken method is triggered and the token is expired. In this case the firebaseToken is updated to
null
.
The callback method was initially not planned. I had a discussion with pavanshankar@ and we decided on decoupling the persistence logic with the callback method.
Created a PR - #9138 for persisting the firebaseToken for BYO-CIAM.
@@ -280,6 +280,12 @@ export interface Auth { | |||
callback: (user: User | null) => void | Promise<void>, | |||
onAbort?: () => void | |||
): Unsubscribe; | |||
|
|||
onFirebaseTokenChanged( |
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.
Related: this method was not part of the API review. I'm concerned that onFirebaseTokenChanged
(and the concept of a FirebaseToken
) is very generic sounding. I'm worried it'll confuse users.
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.
Agreed.
The onFirebaseTokenChanged
callback method was initially not planned during the API Review. Had a discussion with pavanshankar@ offline. Currently decoupling the callback from the persistence changes.
Created a PR - #9138 for persisting the firebaseToken for BYO-CIAM.
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.
We should go through another API review process surfacing this. "firebaseToken" is a really generic name -- "Firebase" is a huge suite of products that has many different types of tokens. Any and every change to the public API surface needs to go through review
Hey there! So you want to contribute to a Firebase SDK?
Before you file this pull request, please read these guidelines:
Discussion
Testing