OIDC SPA
GitHubHome
v5
  • Documentation
  • Release Notes & Upgrade Instructions
v5
  • Documentation
    • 🔩Installation
    • 👨‍🔧Basic Usage
    • 🔌Web API
    • ⏲️Auto Logout
    • ❗Error Management
    • 🎭Mock
    • 🔁Tokens Renewal
    • 🛡️Globally Enforce Authentication
    • 🔐User Account Management
    • 🔄Doing Something Only When a New Session is Created
    • 👨‍🔧User impersonation
    • 👮Disabeling token persistance
  • Example setups
    • 🛣️TanStack Router
    • 🛤️React Router
  • Resources
    • 🔑Keycloak Configuration Guide
    • 🍪End of third-party cookies
    • 🗝️JWT Of the Access Token
    • 💬Discord Server
    • ⬆️Migration Guides
      • ⬆️v4 -> v5
  • ⭐Sponsors
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Documentation

Disabeling token persistance

By default, oidc-spa saves tokens in session storage, allowing users to skip when they reload your app (CTRL + R). However, token persistence can be disabled, and everything will still function as expected. The only difference is that reloading the app may take slightly longer.

import { createOidc } from "oidc-spa";

const oidc = await createOidc({
  // ...
  doDisableTokenPersistence: true
});
import { createReactOidc } from "oidc-spa/react";

export const {
    OidcProvider,
    useOidc
} = createReactOidc({
    // ...
    doDisableTokenPersistence: true
})
PreviousUser impersonationNextTanStack Router

Last updated 6 months ago

Was this helpful?

👮