Storing token in memory #authjs #react

Hi, I’m using okta-auth-js and okta-react with pkce method in an SPA. The app is working fine, having ‘okta-token-storage_accessToken’ and ‘okta-token-storage_idToken’ stored in cookies.
For some secturity reasons, I want to move those two tokens from cookies to memery, so I try changing ‘storageTypes’ in the config file, but it results the app falling into infinit redirecting to /callback loop.

This is the config file:

export default {
  oidc: {
    clientId: environments.authoriseClientId || '{clientId}',
    issuer: environments.authoriseUrl,
    redirectUri: environments.authoriseRedirectUrl,
    scopes: ['openid', 'profile', 'email'],
    autoRenew: true,
    renewOnTabActivation: true,
    autoRemove: true,
    pkce: true,
    disableHttpsCheck: environments.oktaTestingDisableHttpsCheck,
    storageManager: {
      token: {
        storageTypes: ['memory'] as StorageType[],
        secure: true,
        sameSite: 'Lax',
      },
    },
  },
  app: {
    basename: environments.baseName,
  },
};

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.