From 690b685e605bbe37a18ea0208a9ee82d58a475cf Mon Sep 17 00:00:00 2001 From: LekoArts Date: Fri, 15 Nov 2024 15:14:14 +0100 Subject: [PATCH 1/2] initial --- docs/quickstarts/tanstack-start.mdx | 21 ++++++++++----------- docs/references/tanstack-start/get-auth.mdx | 5 +++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/quickstarts/tanstack-start.mdx b/docs/quickstarts/tanstack-start.mdx index 039a6692a0..8ff9180649 100644 --- a/docs/quickstarts/tanstack-start.mdx +++ b/docs/quickstarts/tanstack-start.mdx @@ -100,7 +100,7 @@ description: Learn how to use Clerk to quickly and easily add secure authenticat ```tsx {{ filename: 'app/routes/__root.tsx', ins: [4, 18, 29] }} import { Outlet, ScrollRestoration, createRootRoute } from '@tanstack/react-router' - import { Body, Head, Html, Meta, Scripts } from '@tanstack/start' + import { Meta, Scripts } from '@tanstack/start' import * as React from 'react' import { ClerkProvider } from '@clerk/tanstack-start' @@ -117,16 +117,16 @@ description: Learn how to use Clerk to quickly and easily add secure authenticat function RootDocument({ children }: { children: React.ReactNode }) { return ( - - + + - - + + {children} - - + + ) } @@ -166,12 +166,10 @@ description: Learn how to use Clerk to quickly and easily add secure authenticat

Index Route

You are signed in

-

You are signed out

-
@@ -190,9 +188,10 @@ description: Learn how to use Clerk to quickly and easily add secure authenticat import { createFileRoute, redirect } from '@tanstack/react-router' import { createServerFn } from '@tanstack/start' import { getAuth } from '@clerk/tanstack-start/server' + import { getWebRequest } from 'vinxi/http' - const authStateFn = createServerFn('GET', async (_, { request }) => { - const { userId } = await getAuth(request) + const authStateFn = createServerFn({ method: 'GET' }).handler(async () => { + const { userId } = await getAuth(getWebRequest()) if (!userId) { // This will error because you're redirecting to a path that doesn't exist yet diff --git a/docs/references/tanstack-start/get-auth.mdx b/docs/references/tanstack-start/get-auth.mdx index a14080cecb..30b494127c 100644 --- a/docs/references/tanstack-start/get-auth.mdx +++ b/docs/references/tanstack-start/get-auth.mdx @@ -35,9 +35,10 @@ The following example demonstrates how to use `getAuth()` to retrieve authentica import { createFileRoute, useRouter, redirect } from '@tanstack/react-router' import { createServerFn } from '@tanstack/start' import { getAuth } from '@clerk/tanstack-start/server' +import { getWebRequest } from 'vinxi/http' -const authStateFn = createServerFn('GET', async (_, { request }) => { - const { userId } = await getAuth(request) +const authStateFn = createServerFn({ method: 'GET' }).handler(async () => { + const { userId } = await getAuth(getWebRequest()) if (!userId) { // This might error if you're redirecting to a path that doesn't exist yet From 39ad4f825b2dc745412dee210545fd13ceb09dab Mon Sep 17 00:00:00 2001 From: Lennart Date: Fri, 15 Nov 2024 15:38:38 +0100 Subject: [PATCH 2/2] remove beta tags from install --- docs/quickstarts/tanstack-start.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/quickstarts/tanstack-start.mdx b/docs/quickstarts/tanstack-start.mdx index 8ff9180649..ba6716564d 100644 --- a/docs/quickstarts/tanstack-start.mdx +++ b/docs/quickstarts/tanstack-start.mdx @@ -39,15 +39,15 @@ description: Learn how to use Clerk to quickly and easily add secure authenticat ```bash {{ filename: 'terminal' }} - npm install @clerk/tanstack-start@beta + npm install @clerk/tanstack-start ``` ```bash {{ filename: 'terminal' }} - yarn add @clerk/tanstack-start@beta + yarn add @clerk/tanstack-start ``` ```bash {{ filename: 'terminal' }} - pnpm add @clerk/tanstack-start@beta + pnpm add @clerk/tanstack-start ```