-
Notifications
You must be signed in to change notification settings - Fork 982
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
* Implement InitializeAuth changes for BYO-CIAM Firebase Auth * Removing white space * Addressing review comments * Adding Unit test for initializeAuth with TenantConfig dependency * Running yarn run demo * Update doc
* Throw not supported exception in _performApiRequest
* Throw Operation Not Allowed for Invalid Auth Endpoint (#9013) (#9019) * Throw Operation Not Allowed for Invalid Auth Endpoint (#9013) (#9019) * Implement exchangeToken public api * Using expiry_in returned by backend * Addressing review comments and adding some Unit test * Docgen * Addressing review comments and adding some Unit test * Typo * yarn docgen * Fixing typo * yarn run format
* Write Firebase Token to Auth instance * yarn run format * Fix unit test and run yarn docgen:all * Address comments
* Write Firebase Token to Auth instance * yarn run format * Fix unit test and run yarn docgen:all * getFirebaseToken Auth Interop method for BYO-CIAM * Add unit test * Adding Unit test * Running yarn docgen:all * Use getToken instead of getFirebaseToken * Adding Unit test * yarn run format * Remove unused method
|
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.
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.
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
b18b769
to
ac2fc52
Compare
Hey there! So you want to contribute to a Firebase SDK?
Before you file this pull request, please read these guidelines:
Discussion
Testing