react-aad
react-aad copied to clipboard
Amass of msal tokens at localStorage and cookies
trafficstars
Library versions
react-aad-msal: 1.1.3msal: 2.3.5
Describe the bug If application works during long period of time tokens start amass at localStorage and cookies (I already have about 100 tokens). Looks like some issue with connection and sleep mode on a laptop, but I'm not sure...
Expected behavior There should be only latest tokens in the cache.
Code snippet
// PII - Personally Identifiable Information
const isPiiLoggingEnabled = NODE_ENV !== 'production';
const logger = new Logger(
(logLevel, message, containsPii) => {
console.log("[MSAL]", message);
},
{
level: LogLevel.Verbose,
piiLoggingEnabled: isPiiLoggingEnabled
}
);
export const authProvider = new MsalAuthProvider(
{
auth: {
clientId,
authority: 'https://login.microsoftonline.com/<some-id>',
redirectUri: ssoRedirectUri
},
cache: {
cacheLocation: 'localStorage',
storeAuthStateInCookie: true
},
system: {
tokenRenewalOffsetSeconds: 300,
logger
}
},
{
scopes: ['https://graph.microsoft.com/User.Read']
},
{
loginType: LoginType.Redirect,
tokenRefreshUri: ssoRefreshUri
}
);
Desktop (please complete the following information):
- OS: macOS, Windows
- Browser chrome
- Version 84+