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
[msal-browser][msal-common] Make library state an object and add timestamp (Updated) #1790
Conversation
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.
Generally looks good, just missing tests
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.
A few changes requested, agree about tests.
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.
One nitpick but otherwise LGTM
@@ -932,7 +959,7 @@ describe("PublicClientApplication.ts Class Unit Tests", () => { | |||
"tid": "3338040d-6c67-4c5b-b112-36a304b66dad", | |||
"nonce": "123523", | |||
}; | |||
const testAccount: IAccount = { | |||
const testAccount: AccountInfo = { |
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.
It looks like we recreate this testAccount in a lot of places. Can we just declare this at the top of the file or in a utils file once?
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.
Will optimize tests in a later PR.
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 good to me
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.
LGTM. @sameerag to follow up on the impact if state
is supported in node
This PR is an update of #1675, made because the cache update drastically changed the surface of the library. The changes made in this PR will be merged, and #1675 will be closed.
This PR converts library state from a GUID to a stringified JSON object with id and timestamp fields. This will allow msal-common and msal-browser to handle situations where responses are handled long after the request was initiated, and setting correct token expiration lifetimes.
Also includes tests.