You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docus/content/1.getting-started/1.introduction.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ Default:
109
109
- `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->URLConfiguration->RedirectURLs`.
110
110
- `include`: Routes to include in the redirect. `['/admin(/*)?']` will enable the redirect only for the `admin` page and all sub-pages.
111
111
- `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.
113
113
114
114
### `cookiePrefix`
115
115
@@ -163,7 +163,7 @@ Default:
163
163
164
164
Customize the Supabase client options [available here](https://supabase.com/docs/reference/javascript/initializing#parameters).
165
165
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).
167
167
168
168
```ts
169
169
clientOptions: {
@@ -179,7 +179,7 @@ If `useSsrCookies` is enabled, these options will be merged with values from `@s
179
179
### `cookieName`
180
180
181
181
::warning
182
-
This option is deprecated, use [`cookiePrefix`](/get-started#cookieprefix) instead.
182
+
This option is deprecated, use [`cookiePrefix`](/getting-started/introduction#cookieprefix) instead.
183
183
::
184
184
185
185
Default: `sb`
@@ -189,7 +189,7 @@ Cookie name used for storing the redirect path when using the `redirectOptions.c
189
189
### `redirectOptions.cookieRedirect`
190
190
191
191
::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.
193
193
::
194
194
195
195
Default: `false`
@@ -198,7 +198,7 @@ Use the `cookieRedirect` option to store the redirect path in a cookie.
198
198
199
199
## Demo
200
200
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).
202
202
203
203
[](https://n3-supabase.netlify.app)
Copy file name to clipboardExpand all lines: docus/content/1.getting-started/2.authentication.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,12 @@ With the default options, the module requires a log-in page and a confirm page t
8
8
All you need to do is to create a `login.vue` and `confirm.vue` page in the `pages` folder.
9
9
10
10
::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).
12
12
::
13
13
14
14
## Log-in page - `/login`
15
15
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.
17
17
18
18
::warning
19
19
Ensure to activate the authentication providers you want in the Supabase Dashboard under `Authentication -> Providers`.
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).
53
53
54
54
## Confirm page - `/confirm`
55
55
@@ -78,9 +78,9 @@ watch(user, () => {
78
78
79
79
### Redirect path
80
80
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.
82
82
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:
84
84
85
85
```vue [pages/confirm.vue]
86
86
<script setup lang="ts">
@@ -103,5 +103,5 @@ watch(user, () => {
103
103
```
104
104
105
105
::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.
Copy file name to clipboardExpand all lines: docus/content/2.composables/useSupabaseClient.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,14 @@ description: Make requests to the Supabase API with the useSupabaseClient compos
7
7
8
8
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).
9
9
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).
11
11
12
12
## Authentication
13
13
14
14
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:
15
15
16
16
::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).
18
18
::
19
19
20
20
```ts
@@ -38,7 +38,7 @@ const signOut = async () => {
38
38
</script>
39
39
```
40
40
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.
42
42
43
43
## Database Request
44
44
@@ -101,7 +101,7 @@ onUnmounted(() => {
101
101
102
102
## Typescript
103
103
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.
Copy file name to clipboardExpand all lines: docus/content/2.composables/useSupabaseCookieRedirect.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ The `useSupabaseCookieRedirect` composable provides a simple way to handle stori
7
7
8
8
## Usage
9
9
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).
11
11
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.
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).
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.
16
16
::
17
17
18
18
## Auth middleware
19
19
20
20
::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.
22
22
::
23
23
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:
Copy file name to clipboardExpand all lines: docus/content/2.composables/useSupabaseUser.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,10 @@ const user = useSupabaseUser()
14
14
## Auth middleware
15
15
16
16
::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.
18
18
::
19
19
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:
Copy file name to clipboardExpand all lines: docus/content/3.services/1.serverSupabaseClient.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: Make requests to the Supabase API on server side with the serverSup
7
7
This section assumes you're familiar with [Nitro](https://v3.nuxtjs.org/guide/concepts/server-engine), the server engine powered by Nuxt.
8
8
::
9
9
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).
11
11
12
12
Define your server route and just import the `serverSupabaseClient` from `#supabase/server`. Be careful, `serverSupabaseClient` is returning a promise.
Copy file name to clipboardExpand all lines: docus/content/3.services/2.serverSupabaseServiceRole.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ This section assumes you're familiar with [Nitro](https://v3.nuxtjs.org/guide/co
11
11
12
12
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.
13
13
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).
15
15
16
16
> 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).
Copy file name to clipboardExpand all lines: docus/content/3.services/3.serverSupabaseSession.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@ description: Get your Supabase user's session from serverside with the serverSup
7
7
This section assumes you're familiar with [Nitro](https://v3.nuxtjs.org/guide/concepts/server-engine), the server engine powered by Nuxt.
8
8
::
9
9
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).
11
11
12
12
::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)
14
14
::
15
15
16
16
Define your server route and import the `serverSupabaseSession` from `#supabase/server`.
0 commit comments