-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Refactor token cache entities into types #6580
Conversation
Codecov Report
*This pull request uses carry forward flags. Click here to find out more.
|
…icrosoft-authentication-library-for-js into refactor-TokenEntities
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. Is there a reason why we're not doing the same for AccountEntity?
I will do the other entities in separate PR(s). Was trying to keep this as small as possible, but it ended up pretty big anyway :/ |
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.
Some small comments.
Refactors
CredentialEntity
,IdTokenEntity
,AccessTokenEntity
, andRefreshTokenEntity
to be Types rather than a Class and moves static class methods into functions exported to theCacheHelpers
namespace.Making these types and separating the class methods from the type definition allows us to read from the cache and directly use the value without needing to first copy each key/value pair into an instance of the class (the
toObject
helper function). Doing it this way also results in a small bundle size improvement.Reviews can be focused on the
msal-common/src/cache
folder. The rest of the changes are repetitively changing references to the affected functions