Skip to content

Commit 410463e

Browse files
committed
docs: fix links
1 parent aa719d1 commit 410463e

File tree

12 files changed

+32
-32
lines changed

12 files changed

+32
-32
lines changed

docus/content/1.getting-started/1.introduction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Default:
109109
- `callback`: This is the path the user will be redirect to after supabase login redirection. Should match configured `redirectTo` option of your [signIn method](https://supabase.com/docs/reference/javascript/auth-signinwithoauth). Should also be configured in your Supabase dashboard under `Authentication -> URL Configuration -> Redirect URLs`.
110110
- `include`: Routes to include in the redirect. `['/admin(/*)?']` will enable the redirect only for the `admin` page and all sub-pages.
111111
- `exclude`: Routes to exclude from the redirect. `['/foo', '/bar/**']` will exclude the `foo` page and all pages in your `bar` folder.
112-
- `saveRedirectToCookie`: Automatically sets a cookie containing the path an unauthenticated user tried to access. The value can be accessed using the [`useSupabaseCookieRedirect`](/usage/composables/usesupabasecookieredirect) composable to redirect the user to the page they previously tried to visit.
112+
- `saveRedirectToCookie`: Automatically sets a cookie containing the path an unauthenticated user tried to access. The value can be accessed using the [`useSupabaseCookieRedirect`](/composables/usesupabasecookieredirect) composable to redirect the user to the page they previously tried to visit.
113113
114114
### `cookiePrefix`
115115
@@ -163,7 +163,7 @@ Default:
163163
164164
Customize the Supabase client options [available here](https://supabase.com/docs/reference/javascript/initializing#parameters).
165165
166-
If `useSsrCookies` is enabled, these options will be merged with values from `@supabase/ssr`, and some of the [options cannot be customized](/get-started#usessrcookies).
166+
If `useSsrCookies` is enabled, these options will be merged with values from `@supabase/ssr`, and some of the [options cannot be customized](/getting-started/introduction#usessrcookies).
167167
168168
```ts
169169
clientOptions: {
@@ -179,7 +179,7 @@ If `useSsrCookies` is enabled, these options will be merged with values from `@s
179179
### `cookieName`
180180
181181
::warning
182-
This option is deprecated, use [`cookiePrefix`](/get-started#cookieprefix) instead.
182+
This option is deprecated, use [`cookiePrefix`](/getting-started/introduction#cookieprefix) instead.
183183
::
184184
185185
Default: `sb`
@@ -189,7 +189,7 @@ Cookie name used for storing the redirect path when using the `redirectOptions.c
189189
### `redirectOptions.cookieRedirect`
190190
191191
::warning
192-
This option is deprecated, use [`redirectOptions.saveRedirectToCookie`](/get-started#redirectoptions) instead.
192+
This option is deprecated, use [`redirectOptions.saveRedirectToCookie`](/getting-started/introduction#redirectoptions) instead.
193193
::
194194
195195
Default: `false`
@@ -198,7 +198,7 @@ Use the `cookieRedirect` option to store the redirect path in a cookie.
198198
199199
## Demo
200200
201-
A live demo is made for you to see this module in action on [n3-supabase.netlify.app](https://n3-supabase.netlify.app), read more in the [demo section](/demo).
201+
A live demo is made for you to see this module in action on [n3-supabase.netlify.app](https://n3-supabase.netlify.app), read more in the [demo section](/getting-started/demo).
202202
203203
[![Supabase demo with Nuxt 3](https://user-images.githubusercontent.com/904724/160422461-8f87500a-8dec-4413-86b2-ba04e1b2d17b.png)](https://n3-supabase.netlify.app)
204204

docus/content/1.getting-started/2.authentication.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ With the default options, the module requires a log-in page and a confirm page t
88
All you need to do is to create a `login.vue` and `confirm.vue` page in the `pages` folder.
99

1010
::tip
11-
For advanced users who want to implement the auth behaviour themselves, you can disable or override the [redirect options](/get-started#redirect).
11+
For advanced users who want to implement the auth behaviour themselves, you can disable or override the [redirect options](/getting-started/introduction#redirect).
1212
::
1313

1414
## Log-in page - `/login`
1515

16-
Each time a user is trying to access a page that needs authentication, he will automatically be redirected to the configured log in page. If you want to allow access to "public" page, you just need to add them in the [exclude](/get-started#redirectoptions) redirect option. Alternatively, you can enable the redirect only for certain routes using the [include](/get-started#redirectoptions) redirect option.
16+
Each time a user is trying to access a page that needs authentication, he will automatically be redirected to the configured log in page. If you want to allow access to "public" page, you just need to add them in the [exclude](/getting-started/introduction#redirectoptions) redirect option. Alternatively, you can enable the redirect only for certain routes using the [include](/getting-started/introduction#redirectoptions) redirect option.
1717

1818
::warning
1919
Ensure to activate the authentication providers you want in the Supabase Dashboard under `Authentication -> Providers`.
@@ -49,7 +49,7 @@ const signInWithOtp = async () => {
4949
</template>
5050
```
5151

52-
Once the authorization flow is triggered using the `auth` wrapper of the [useSupabaseClient](/usage/composables/usesupabaseclient) composable, the session management is handled automatically and the user will be redirected to the page you specify in the redirect option (`/confirm` by default).
52+
Once the authorization flow is triggered using the `auth` wrapper of the [useSupabaseClient](/composables/usesupabaseclient) composable, the session management is handled automatically and the user will be redirected to the page you specify in the redirect option (`/confirm` by default).
5353

5454
## Confirm page - `/confirm`
5555

@@ -78,9 +78,9 @@ watch(user, () => {
7878

7979
### Redirect path
8080

81-
You can easily handle redirection to the initial requested route after login using the [`useSupabaseCookieRedirect`](/usage/composables/usesupabasecookieredirect) composable and the [`saveRedirectToCookie`](/get-started#redirectoptions) option.
81+
You can easily handle redirection to the initial requested route after login using the [`useSupabaseCookieRedirect`](/composables/usesupabasecookieredirect) composable and the [`saveRedirectToCookie`](/getting-started/introduction#redirectoptions) option.
8282

83-
By setting the `saveRedirectToCookie` option to `true`, the module will automatically save the current path to a cookie when the user is redirected to the login page. When the user logs in, you can then retrieve the saved path from the cookie and redirect the user to it on the [`/confirm`](/authentication#confirm-page-confirm) page:
83+
By setting the `saveRedirectToCookie` option to `true`, the module will automatically save the current path to a cookie when the user is redirected to the login page. When the user logs in, you can then retrieve the saved path from the cookie and redirect the user to it on the [`/confirm`](/getting-started/authentication#confirm-page-confirm) page:
8484

8585
```vue [pages/confirm.vue]
8686
<script setup lang="ts">
@@ -103,5 +103,5 @@ watch(user, () => {
103103
```
104104

105105
::tip
106-
If you want to manually set the redirect path, you can do so by disabling [`saveRedirectToCookie`](/get-started#redirectoptions), and then set the value using the [`useSupabaseCookieRedirect`](/usage/composables/usesupabasecookieredirect) composable directly.
106+
If you want to manually set the redirect path, you can do so by disabling [`saveRedirectToCookie`](/getting-started/introduction#redirectoptions), and then set the value using the [`useSupabaseCookieRedirect`](/composables/usesupabasecookieredirect) composable directly.
107107
::

docus/content/1.getting-started/3.demo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ You can play with the demo on [n3-supabase.netlify.app](https://n3-supabase.netl
1313

1414
## Running locally
1515

16-
Follow the instruction in the [demo Readme](https://github.com/nuxt-community/supabase-module/tree/main/demo).
16+
Follow the instruction in the [demo Readme](https://github.com/nuxt-community/supabase-module/tree/main/getting-started/demo).
1717

1818
## Source code
1919

20-
The source code is available on Github in the [demo/ directory](https://github.com/nuxt-community/supabase-module/tree/main/demo).
20+
The source code is available on Github in the [demo/ directory](https://github.com/nuxt-community/supabase-module/tree/main/getting-started/demo).

docus/content/2.composables/useSupabaseClient.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ description: Make requests to the Supabase API with the useSupabaseClient compos
77

88
This composable is using [supabase-js](https://github.com/supabase/supabase-js/) under the hood, it gives access to the [Supabase client](https://supabase.com/docs/reference/javascript/initializing).
99

10-
> The client is initialized with the `SUPABASE_KEY` you must have in your `.env` file. It establishes the connection with the database and make use of user JWT to apply [RLS Policies](https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security) implemented in Supabase. If you want to bypass policies, you can use the [serverSupabaseServiceRole](/usage/services/serversupabaseservicerole).
10+
> The client is initialized with the `SUPABASE_KEY` you must have in your `.env` file. It establishes the connection with the database and make use of user JWT to apply [RLS Policies](https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security) implemented in Supabase. If you want to bypass policies, you can use the [serverSupabaseServiceRole](/services/serversupabaseservicerole).
1111
1212
## Authentication
1313

1414
The useSupabaseClient composable is providing all methods to manage authorization under `useSupabaseClient().auth`. For more details please see the [supabase-js auth documentation](https://supabase.com/docs/reference/javascript/auth-api). Here is an example for signing in and out:
1515

1616
::tip
17-
If you want a full explanation on how to handle the authentication process, please read this [section](/authentication).
17+
If you want a full explanation on how to handle the authentication process, please read this [section](/getting-started/authentication).
1818
::
1919

2020
```ts
@@ -38,7 +38,7 @@ const signOut = async () => {
3838
</script>
3939
```
4040

41-
Please also take a look at [Get Started](/authentication) for the authorization flow.
41+
Please also take a look at [Get Started](/getting-started/authentication) for the authorization flow.
4242

4343
## Database Request
4444

@@ -101,7 +101,7 @@ onUnmounted(() => {
101101

102102
## Typescript
103103

104-
Database typings are passed to the client out of the box if the database generated types are found at `./types/database.types.ts` or [your configured types path](/get-started#types). Check Supabase [documentation](https://supabase.com/docs/reference/javascript/release-notes#typescript-support) for further information.
104+
Database typings are passed to the client out of the box if the database generated types are found at `./types/database.types.ts` or [your configured types path](/getting-started/introduction#types). Check Supabase [documentation](https://supabase.com/docs/reference/javascript/release-notes#typescript-support) for further information.
105105

106106
```shell
107107
## Generate types from live database

docus/content/2.composables/useSupabaseCookieRedirect.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ The `useSupabaseCookieRedirect` composable provides a simple way to handle stori
77

88
## Usage
99

10-
This composable can be [manually used](#manual-usage) to save and retrieve a redirect path. However, the redirect path can automatically be set via the `saveRedirectToCookie` option in the [redirectOptions](/get-started#redirectoptions).
10+
This composable can be [manually used](#manual-usage) to save and retrieve a redirect path. However, the redirect path can automatically be set via the `saveRedirectToCookie` option in the [redirectOptions](/getting-started/introduction#redirectoptions).
1111

12-
The redirect path is not automatically used. Instead you must implement the logic to redirect the user to the saved path, for example on the [`/confirm`](/authentication#confirm-page-confirm) page.
12+
The redirect path is not automatically used. Instead you must implement the logic to redirect the user to the saved path, for example on the [`/confirm`](/getting-started/authentication#confirm-page-confirm) page.
1313

1414
```vue
1515
<script setup>
@@ -51,4 +51,4 @@ const currentPath = redirectInfo.path.value
5151
const path = redirectInfo.pluck()
5252
```
5353

54-
The cookie is saved with the name `{cookiePrefix}-redirect-path` where `cookiePrefix` is defined in the [runtime config](/get-started#runtime-config).
54+
The cookie is saved with the name `{cookiePrefix}-redirect-path` where `cookiePrefix` is defined in the [runtime config](/getting-started/introduction#runtime-config).

docus/content/2.composables/useSupabaseSession.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ const session = useSupabaseSession()
1212
```
1313

1414
::tip
15-
If you just need the User's information you can use [useSupabaseUser](/usage/composables/usesupabaseuser) which returns just the User information of the session.
15+
If you just need the User's information you can use [useSupabaseUser](/composables/usesupabaseuser) which returns just the User information of the session.
1616
::
1717

1818
## Auth middleware
1919

2020
::tip
21-
By default, the module is implementing a redirect middleware. All pages of your application are automatically redirected to the [login](/get-started#redirectoptions) page. However, you can allow redirection to "public" pages by setting the [exclude](/get-started#redirectoptions) redirect option. Alternatively, you can enable the redirect only for certain routes using the [include](/get-started#redirectoptions) redirect option.
21+
By default, the module is implementing a redirect middleware. All pages of your application are automatically redirected to the [login](/getting-started/introduction#redirectoptions) page. However, you can allow redirection to "public" pages by setting the [exclude](/getting-started/introduction#redirectoptions) redirect option. Alternatively, you can enable the redirect only for certain routes using the [include](/getting-started/introduction#redirectoptions) redirect option.
2222
::
2323

24-
If the [redirect](/get-started#redirect) option is disabled, you can protect your authenticated routes by creating a custom middleware in your project, here is an example:
24+
If the [redirect](/getting-started/introduction#redirect) option is disabled, you can protect your authenticated routes by creating a custom middleware in your project, here is an example:
2525

2626
```ts [middleware/auth.ts]
2727
export default defineNuxtRouteMiddleware((to, _from) => {

docus/content/2.composables/useSupabaseUser.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ const user = useSupabaseUser()
1414
## Auth middleware
1515

1616
::tip
17-
By default, the module is implementing a redirect middleware. All pages of your application are automatically redirected to the [login](/get-started#redirectoptions) page. However, you can allow redirection to "public" pages by setting the [exclude](/get-started#redirectoptions) redirect option. Alternatively, you can enable the redirect only for certain routes using the [include](/get-started#redirectoptions) redirect option.
17+
By default, the module is implementing a redirect middleware. All pages of your application are automatically redirected to the [login](/getting-started/introduction#redirectoptions) page. However, you can allow redirection to "public" pages by setting the [exclude](/getting-started/introduction#redirectoptions) redirect option. Alternatively, you can enable the redirect only for certain routes using the [include](/getting-started/introduction#redirectoptions) redirect option.
1818
::
1919

20-
If the [redirect](/get-started#redirect) option is disabled, you can protect your authenticated routes by creating a custom middleware in your project, here is an example:
20+
If the [redirect](/getting-started/introduction#redirect) option is disabled, you can protect your authenticated routes by creating a custom middleware in your project, here is an example:
2121

2222
```ts [middleware/auth.ts]
2323
export default defineNuxtRouteMiddleware((to, _from) => {

docus/content/3.services/1.serverSupabaseClient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Make requests to the Supabase API on server side with the serverSup
77
This section assumes you're familiar with [Nitro](https://v3.nuxtjs.org/guide/concepts/server-engine), the server engine powered by Nuxt.
88
::
99

10-
This function is working similary as the [useSupabaseClient](/usage/composables/usesupabaseclient) composable but is designed to be used in [server routes](https://nuxt.com/docs/guide/directory-structure/server#server-routes).
10+
This function is working similary as the [useSupabaseClient](/composables/usesupabaseclient) composable but is designed to be used in [server routes](https://nuxt.com/docs/guide/directory-structure/server#server-routes).
1111

1212
Define your server route and just import the `serverSupabaseClient` from `#supabase/server`. Be careful, `serverSupabaseClient` is returning a promise.
1313

docus/content/3.services/2.serverSupabaseServiceRole.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This section assumes you're familiar with [Nitro](https://v3.nuxtjs.org/guide/co
1111

1212
This function is designed to work only in [server routes](https://nuxt.com/docs/guide/directory-structure/server#server-routes), there is no vue composable equivalent.
1313

14-
It works similary as the [serverSupabaseClient](/usage/services/serversupabaseclient) but it provides a client with super admin rights that can bypass your [Row Level Security](https://supabase.com/docs/guides/auth/row-level-security).
14+
It works similary as the [serverSupabaseClient](/services/serversupabaseclient) but it provides a client with super admin rights that can bypass your [Row Level Security](https://supabase.com/docs/guides/auth/row-level-security).
1515

1616
> The client is initialized with the `SUPABASE_SERVICE_KEY` you must have in your `.env` file. Checkout the doc if you want to know more about [Supabase keys](https://supabase.com/docs/learn/auth-deep-dive/auth-deep-dive-jwts#jwts-in-supabase).
1717

docus/content/3.services/3.serverSupabaseSession.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ description: Get your Supabase user's session from serverside with the serverSup
77
This section assumes you're familiar with [Nitro](https://v3.nuxtjs.org/guide/concepts/server-engine), the server engine powered by Nuxt.
88
::
99

10-
This function is similar to the [useSupabaseSession](/usage/composables/usesupabasesession) composable but is used in [server routes](https://nuxt.com/docs/guide/directory-structure/server#server-routes).
10+
This function is similar to the [useSupabaseSession](/composables/usesupabasesession) composable but is used in [server routes](https://nuxt.com/docs/guide/directory-structure/server#server-routes).
1111

1212
::warning
13-
Be advised that `serverSupabaseSession` is considered unsafe, since the session comes from the client and users can tamper with it. For checking if the user is logged in, always use [serverSupabaseUser](/usage/services/serversupabaseuser)
13+
Be advised that `serverSupabaseSession` is considered unsafe, since the session comes from the client and users can tamper with it. For checking if the user is logged in, always use [serverSupabaseUser](/services/serversupabaseuser)
1414
::
1515

1616
Define your server route and import the `serverSupabaseSession` from `#supabase/server`.

0 commit comments

Comments
 (0)