rsnext/examples/with-supertokens
Rishabh Poddar 90ddc248a5
(with-supertokens example): Fixes infinite redirect issue for unauthorised error during SSR (#42634)
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.
2022-11-08 07:58:04 -08:00
..
config Update with-supertokens example (#41802) 2022-10-26 01:18:18 -07:00
pages (with-supertokens example): Fixes infinite redirect issue for unauthorised error during SSR (#42634) 2022-11-08 07:58:04 -08:00
public Add Supertokens example (#21384) 2021-02-15 15:41:45 -06:00
styles Add Supertokens example (#21384) 2021-02-15 15:41:45 -06:00
.env Updates with-supertokens example to add sign in with apple (#31200) 2021-11-12 19:54:28 -06:00
.gitignore Update default gitignore templates (#39051) 2022-07-26 20:08:40 -05:00
interfaces.d.ts Refactored the with-supertokens example to use typescript (#39987) 2022-08-29 12:40:26 -05:00
next.config.js Update to with-supertokens example (#35991) 2022-04-11 12:22:47 +02:00
package.json Update with-supertokens example (#41802) 2022-10-26 01:18:18 -07:00
README.md docs(examples): improve DX while copying command to create new project (#38410) 2022-07-26 21:57:48 -05:00
tsconfig.json Refactored the with-supertokens example to use typescript (#39987) 2022-08-29 12:40:26 -05:00

SuperTokens Example

This is a simple set up for applications protected by SuperTokens.

How to use

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 on http://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.