diff --git a/README.md b/README.md index eab4f09..55a6602 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,9 @@ yarn add --dev @bitinflow/nuxt-oauth npm install --save-dev @bitinflow/nuxt-oauth ``` -2. Add `@bitinflow/nuxt-oauth` to the `modules` section of `nuxt.config.ts` +2. Add `@bitinflow/nuxt-oauth` to the `modules` section of `nuxt.config.ts` and disable `ssr`. + +Or alternatively disable `ssr` via `routeRules`, only for pages where `auth` or `guest` middlewares are needed. Typically account section and login page. ```js export default defineNuxtConfig({ @@ -33,6 +35,13 @@ export default defineNuxtConfig({ '@bitinflow/nuxt-oauth' ], + ssr: false, + // or + routeRules: { + '/account/**': { ssr: false }, + '/auth/**': { ssr: false } + }, + oauth: { redirect: { login: '/login', diff --git a/playground/nuxt.config.ts b/playground/nuxt.config.ts index c41bd40..0e5396a 100644 --- a/playground/nuxt.config.ts +++ b/playground/nuxt.config.ts @@ -1,5 +1,8 @@ export default defineNuxtConfig({ modules: ['../src/module'], + + ssr: false, + oauth: { redirect: { login: '/login/', // sandbox appends / at the end of url