-
Notifications
You must be signed in to change notification settings - Fork 938
Write Firebase Token to Auth instance during exchange_token API #9060
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
|
Vertex AI Mock Responses Check
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
accessToken: string; | ||
expiresIn?: string; | ||
// The time when the access token expires. |
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.
nit: Is this in seconds?
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.
Yes, The expiresIn is in seconds.
@@ -455,6 +457,14 @@ export class AuthImpl implements AuthInternal, _FirebaseService { | |||
}); | |||
} | |||
|
|||
async _updateFirebaseToken( | |||
firebaseToken: FirebaseToken | null |
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.
Do we have to accept null here?
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.
Ah i just saw your new changes in https://github.com/firebase/firebase-js-sdk/pull/9061/files. If this.firebaseToken can be null, then this makes sense.
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. We are updating FirebaseToken with null
after token expiry.
export interface FirebaseToken { | ||
// The firebase access token (JWT signed by Firebase Auth). | ||
readonly token: string; | ||
// The time when the access token expires. |
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.
is this in seconds? Asking because I see you're * 1000
in the above change.
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.
Looks like it's a timestamp (in milliseconds since epoch)? Could we clarify that in a comment to be more clear? Thanks!
Discussion
Testing