From 15c3d438315ed4c203ce0a4ea122f034e3334a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Preu=C3=9F?= Date: Sat, 18 Feb 2023 14:45:14 +0100 Subject: [PATCH] Add important documentation --- README.md | 11 ++++++++++- playground/nuxt.config.ts | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) 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