diff --git a/apps/docs/components/Navigation/Navigation.constants.ts b/apps/docs/components/Navigation/Navigation.constants.ts index db255e9b121..57a10d0e4c2 100644 --- a/apps/docs/components/Navigation/Navigation.constants.ts +++ b/apps/docs/components/Navigation/Navigation.constants.ts @@ -134,17 +134,21 @@ export const menuItems: NavMenu = { name: 'Deep Dive', url: undefined, items: [ - { name: 'Part One: JWTs', url: '/learn/auth-deep-dive/jwts', items: [] }, { - name: 'Part Two: Row Level Security', - url: '/learn/auth-deep-dive/row-level-security', + name: 'Part One: JWTs', + url: '/learn/auth-deep-dive/auth-deep-dive-jwts', items: [], }, - { name: 'Part Three: Policies', url: '/learn/auth-deep-dive/policies', items: [] }, - { name: 'Part Four: GoTrue', url: '/learn/auth-deep-dive/gotrue', items: [] }, + { + name: 'Part Two: Row Level Security', + url: '/learn/auth-deep-dive/auth-row-level-security', + items: [], + }, + { name: 'Part Three: Policies', url: '/learn/auth-deep-dive/auth-policies', items: [] }, + { name: 'Part Four: GoTrue', url: '/learn/auth-deep-dive/auth-gotrue', items: [] }, { name: 'Part Five: Google OAuth', - url: '/learn/auth-deep-dive/google-oauth', + url: '/learn/auth-deep-dive/auth-google-oauth', items: [], }, ], diff --git a/apps/docs/docs/guides/auth/auth-helpers/nextjs.mdx b/apps/docs/docs/guides/auth/auth-helpers/nextjs.mdx index 6743884e577..581c6ec5f37 100644 --- a/apps/docs/docs/guides/auth/auth-helpers/nextjs.mdx +++ b/apps/docs/docs/guides/auth/auth-helpers/nextjs.mdx @@ -179,7 +179,7 @@ export default async (req: NextApiRequest, res: NextApiResponse) => { ## Client-side data fetching with RLS -For [row level security](https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security) to work properly when fetching data client-side, you need to make sure to use the `supabaseClient` from the `useSupabaseClient` hook and only run your query once the user is defined client-side in the `useUser()` hook: +For [row level security](/docs/learn/auth-deep-dive/auth-row-level-security) to work properly when fetching data client-side, you need to make sure to use the `supabaseClient` from the `useSupabaseClient` hook and only run your query once the user is defined client-side in the `useUser()` hook: ```jsx lines=10-17 import { Auth, ThemeSupa } from '@supabase/auth-ui-react' @@ -263,7 +263,7 @@ export const getServerSideProps = async (ctx) => { ## Server-side data fetching with RLS -You can use the server supabase client to run [row level security](https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security) authenticated queries server-side: +You can use the server supabase client to run [row level security](/docs/learn/auth-deep-dive/auth-row-level-security) authenticated queries server-side: { - await supabaseClient.auth.signOut() - router.push('/') - }} - > - Logout - - ``` +```jsx + +``` -- The `supabaseClient` and `supabaseServerClient` have been removed in favor of the `createBrowserSupabaseClient` and `createServerSupabaseClient` methods. This allows you to provide the CLI-generated types to the client: +The `supabaseClient` and `supabaseServerClient` have been removed in favor of the `createBrowserSupabaseClient` and `createServerSupabaseClient` methods. This allows you to provide the CLI-generated types to the client: - ```tsx - // client-side - import type { Database } from 'types_db' - const [supabaseClient] = useState(() => createBrowserSupabaseClient()) +```tsx +// client-side +import type { Database } from 'types_db' +const [supabaseClient] = useState(() => createBrowserSupabaseClient()) - // server-side API route - import type { NextApiRequest, NextApiResponse } from 'next' - import type { Database } from 'types_db' +// server-side API route +import type { NextApiRequest, NextApiResponse } from 'next' +import type { Database } from 'types_db' - export default async (req: NextApiRequest, res: NextApiResponse) => { - const supabaseServerClient = createServerSupabaseClient({ - req, - res, - }) - const { - data: { user }, - } = await supabaseServerClient.auth.getUser() +export default async (req: NextApiRequest, res: NextApiResponse) => { + const supabaseServerClient = createServerSupabaseClient({ + req, + res, + }) + const { + data: { user }, + } = await supabaseServerClient.auth.getUser() - res.status(200).json({ name: user?.name ?? '' }) - } - ``` + res.status(200).json({ name: user?.name ?? '' }) +} +``` - The `UserProvider` has been replaced by the `SessionContextProvider`. Make sure to wrap your `pages/_app.js` componenent with the `SessionContextProvider`. Then, throughout your application you can use the `useSessionContext` hook to get the `session` and the `useSupabaseClient` hook to get an authenticated `supabaseClient`. - The `useUser` hook now returns the `user` object or `null`. diff --git a/apps/docs/docs/guides/auth/auth-helpers/remix.mdx b/apps/docs/docs/guides/auth/auth-helpers/remix.mdx index 6a914eee699..5a644521a4f 100644 --- a/apps/docs/docs/guides/auth/auth-helpers/remix.mdx +++ b/apps/docs/docs/guides/auth/auth-helpers/remix.mdx @@ -438,7 +438,7 @@ Given this Remix `
` component. > -Any of the [supported authentication strategies from `supabase-js`](https://supabase.com/docs/reference/javascript/auth-signup) will work server-side. This is how you would handle simple `email` and `password` auth. +Any of the [supported authentication strategies from `supabase-js`](/docs/reference/javascript/auth-signup) will work server-side. This is how you would handle simple `email` and `password` auth. ```jsx export const action = async ({ request }) => { @@ -470,7 +470,7 @@ export const action = async ({ request }) => { -Any of the [supported authentication strategies from `supabase-js`](https://supabase.com/docs/reference/javascript/auth-signup) will work server-side. This is how you would handle simple `email` and `password` auth. +Any of the [supported authentication strategies from `supabase-js`](/docs/reference/javascript/auth-signup) will work server-side. This is how you would handle simple `email` and `password` auth. ```jsx export const action: ActionFunction = async ({ @@ -516,7 +516,7 @@ export const action: ActionFunction = async ({ > -Any of the [supported authentication strategies from `supabase-js`](https://supabase.com/docs/reference/javascript/auth-signinwithpassword) will work server-side. This is how you would handle simple `email` and `password` auth. +Any of the [supported authentication strategies from `supabase-js`](/docs/reference/javascript/auth-signinwithpassword) will work server-side. This is how you would handle simple `email` and `password` auth. ```jsx export const action = async ({ request }) => { @@ -548,7 +548,7 @@ export const action = async ({ request }) => { -Any of the [supported authentication strategies from `supabase-js`](https://supabase.com/docs/reference/javascript/auth-signinwithpassword) will work server-side. This is how you would handle simple `email` and `password` auth. +Any of the [supported authentication strategies from `supabase-js`](/docs/reference/javascript/auth-signinwithpassword) will work server-side. This is how you would handle simple `email` and `password` auth. ```jsx export const action: ActionFunction = async ({ diff --git a/apps/docs/docs/guides/auth/auth-helpers/sveltekit.mdx b/apps/docs/docs/guides/auth/auth-helpers/sveltekit.mdx index 91883170394..f8267ea371c 100644 --- a/apps/docs/docs/guides/auth/auth-helpers/sveltekit.mdx +++ b/apps/docs/docs/guides/auth/auth-helpers/sveltekit.mdx @@ -208,7 +208,7 @@ You can now determine if a user is authenticated on the client-side by checking ## Client-side data fetching with RLS -For [row level security](https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security) to work properly when fetching data client-side, you need to make sure to import the `{ supabaseClient }` from `$lib/db` and only run your query once the user is defined client-side in `$page.data.session`: +For [row level security](/docs/learn/auth-deep-dive/auth-row-level-security) to work properly when fetching data client-side, you need to make sure to import the `{ supabaseClient }` from `$lib/db` and only run your query once the user is defined client-side in `$page.data.session`: ```html