90ddc248a5
If there is an unauthorised error during `getServerSideProps`, then we return the same response as the try refresh token error so that all cookies are cleared from the frontend due to refreshing failure. If we did not do this, it would cause an infinite loop if the session was removed in offline mode as the frontend would still think that the session exists, and would redirect back to the protected route which would fail verification again. |
||
---|---|---|
.. | ||
config | ||
pages | ||
public | ||
styles | ||
.env | ||
.gitignore | ||
interfaces.d.ts | ||
next.config.js | ||
package.json | ||
README.md | ||
tsconfig.json |
SuperTokens Example
This is a simple set up for applications protected by SuperTokens.
How to use
- Execute
create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-supertokens with-supertokens-app
yarn create next-app --example with-supertokens with-supertokens-app
pnpm create next-app --example with-supertokens with-supertokens-app
-
Run
yarn install
-
Run
npm run dev
to start the application onhttp://localhost:3000
.
Notes
- Take a look at SuperTokens documentation.
- We have provided development OAuth keys for the various in build third party providers in the
.env
file. Feel free to use them for development purposes, but please create your own keys for production use.