From 200740b0166861d9f8a005d25846553c558ce3ec Mon Sep 17 00:00:00 2001 From: Charlie Coppinger Date: Wed, 21 Feb 2024 12:44:35 +1300 Subject: [PATCH] docs: fix incorrect .js extension with .ts extension (#19925) * docs: fix incorrect .js extension with .ts extension Within the SvelteKit example, the guide incorrectly references creating a .js file as opposed to a .ts as is required, given the contents of said file has Typescript within it * Update apps/docs/pages/guides/auth/server-side/email-based-auth-with-pkce-flow-for-ssr.mdx * run formatter --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> Co-authored-by: dshukertjr --- ...mail-based-auth-with-pkce-flow-for-ssr.mdx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/docs/content/guides/auth/server-side/email-based-auth-with-pkce-flow-for-ssr.mdx b/apps/docs/content/guides/auth/server-side/email-based-auth-with-pkce-flow-for-ssr.mdx index 02fe242a0a0..24a69be3362 100644 --- a/apps/docs/content/guides/auth/server-side/email-based-auth-with-pkce-flow-for-ssr.mdx +++ b/apps/docs/content/guides/auth/server-side/email-based-auth-with-pkce-flow-for-ssr.mdx @@ -75,30 +75,30 @@ export async function GET(request: NextRequest) { -Create a new file at `src/routes/auth/confirm/+server.js` and populate with the following: +Create a new file at `src/routes/auth/confirm/+server.ts` and populate with the following: -```js src/routes/auth/confirm/+server.js -import { redirect } from '@sveltejs/kit'; +```ts src/routes/auth/confirm/+server.ts +import { redirect } from '@sveltejs/kit' export const GET = async (event) => { - const { - url, - locals: { supabase } - } = event; - const token_hash = url.searchParams.get('token_hash') as string; - const type = url.searchParams.get('type') as string; - const next = url.searchParams.get('next') ?? '/'; + const { + url, + locals: { supabase }, + } = event + const token_hash = url.searchParams.get('token_hash') as string + const type = url.searchParams.get('type') as string + const next = url.searchParams.get('next') ?? '/' if (token_hash && type) { - const { error } = await supabase.auth.verifyOtp({ token_hash, type }); + const { error } = await supabase.auth.verifyOtp({ token_hash, type }) if (!error) { - throw redirect(303, `/${next.slice(1)}`); + throw redirect(303, `/${next.slice(1)}`) } } // return the user to an error page with some instructions - throw redirect(303, '/auth/auth-code-error'); -}; + throw redirect(303, '/auth/auth-code-error') +} ```