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
{{ message }}
Repository navigation
Commit 864f936
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/bug_report.yml
+13-12Lines changed: 13 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ body:
6
6
value: |
7
7
Thank you for reporting an issue :pray:.
8
8
9
-
This issue tracker is for reporting bugs found in `router` (https://github.com/tanstack/router).
9
+
This issue tracker is for reporting bugs found in TanStack Router and/or Start.
10
10
If you have a question about how to achieve something and are struggling, please post a question
11
11
inside of `router` Discussions tab: https://github.com/tanstack/router/discussions
12
12
13
13
Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
The more information you fill in, the better the community can help you.
19
19
- type: dropdown
@@ -36,21 +36,22 @@ body:
36
36
- type: input
37
37
id: link
38
38
attributes:
39
-
label: Your Example Website or App
39
+
label: Complete minimal reproducer
40
40
description: |
41
-
Which website or app were you using when the bug happened?
42
-
Note:
43
-
- Please provide a link via our pre-configured Stackblitz project ([file-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart-file-based?file=src%2Fmain.tsx)|[code-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart?file=src%2Fmain.tsx)) or a link to a repo that can reproduce the issue.
44
-
- Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the `router` npm package / dependency.
45
-
- To create a shareable code example you can use Stackblitz. Please no localhost URLs.
46
-
- Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
41
+
Bug reports need a complete minimal reproducer project.
42
+
The reproducer project must be
43
+
- either a Stackblitz project (use this pre-configured Stackblitz project ([file-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart-file-based?file=src%2Fmain.tsx)|[code-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart?file=src%2Fmain.tsx)))
44
+
- or a public git repo.
45
+
In case of a git repo, the issue must be reproducible **directly** after cloning and installing dependencies.
46
+
47
+
If you dont supply a reproducer that meets the above requirements, this issue will be closed.
47
48
placeholder: reproduction URL
48
49
validations:
49
50
required: true
50
51
- type: textarea
51
52
id: steps
52
53
attributes:
53
-
label: Steps to Reproduce the Bug or Issue
54
+
label: Steps to Reproduce the Bug
54
55
description: Describe the steps we have to take to reproduce the behavior.
- A function that will be called when this route is matched and passed the raw params from the current location and return valid parsed params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function does not throw, its return value will be used as the route's params and the return type will be inferred into the rest of the router.
84
+
- A function that will be called when this route is matched and passed the raw params from the current location and return valid parsed params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function returns parsed params, its return value will be used as the route's params and the return type will be inferred into the rest of the router.
85
+
- Experimental: returning `false` during incoming route matching skips this route and allows matching to continue to another candidate route.
Copy file name to clipboardExpand all lines: docs/router/guide/authenticated-routes.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,8 @@ title: Authenticated Routes
5
5
6
6
Authentication is an extremely common requirement for web applications. In this guide, we'll walk through how to use TanStack Router to build protected routes, and how to redirect users to login if they try to access them.
7
7
8
+
> **A route guard does not protect a server function.** This guide shows how to gate a route's UI behind `beforeLoad`. If you also have a `createServerFn` that fetches sensitive data, the route guard does NOT stop a direct request to that RPC — server functions are reachable by POST regardless of which route renders them. Pair routing-side guards with **handler-level enforcement** (auth middleware or in-handler check). See [Authentication Server Primitives](../../start/framework/react/guide/authentication-server-primitives.md) in the Start docs.
9
+
8
10
## The `route.beforeLoad` Option
9
11
10
12
The `route.beforeLoad` option allows you to specify a function that will be called before a route is loaded. It receives all of the same arguments that the `route.loader` function does. This is a great place to check if a user is authenticated, and redirect them to a login page if they are not.
Copy file name to clipboardExpand all lines: docs/router/guide/ssr.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ title: SSR
8
8
9
9
Server Side Rendering (SSR) is the process of rendering a component on the server and sending the HTML markup to the client. The client then hydrates the markup into a fully interactive component.
10
10
11
+
> **TanStack Router is not Next.js, Remix, or React Router DOM.** When generating routes or components, do **not** use `src/pages/`, `app/layout.tsx`, `_app/index.tsx`, `getServerSideProps`, `getStaticProps`, Remix-style `loader`/`action` exports, or imports from `react-router-dom` or `next/`. TanStack uses `src/routes/` with `createFileRoute`, `Link`/`useNavigate`/`redirect` from `@tanstack/react-router`, and (for Start) `createServerFn` from `@tanstack/<framework>-start`. Wrong-framework code typically fails to build or produces conflicting `/` routes at runtime.
12
+
11
13
There are usually two different flavors of SSR to be considered:
Copy file name to clipboardExpand all lines: docs/start/framework/react/comparison.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,6 +217,7 @@ Key differences:
217
217
- Start's server functions support both client and server middleware
218
218
- Start has built-in input validation
219
219
- Start's approach is more explicit about the client/server boundary
220
+
- Start's server functions support both GET and POST methods (configurable via the `method` option, defaults to GET), while Next.js Server Actions only support POST.
220
221
- Next.js Server Actions integrate more seamlessly with forms
Copy file name to clipboardExpand all lines: docs/start/framework/react/guide/authentication-overview.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,11 +109,11 @@ title: Authentication
109
109
110
110
### 🛠️ DIY Authentication
111
111
112
-
Build your own authentication system using TanStack Start's server functions and session management:
112
+
Build your own authentication system using TanStack Start's server functions and session management. Start with the [Authentication Server Primitives](./authentication-server-primitives.md) guide — it covers session cookies (`HttpOnly`/`Secure`/`SameSite`/`__Host-`), session lookup as middleware, OAuth `state` + PKCE, password-reset enumeration defense, CSRF, rate limiting, and session rotation, with the WRONG/CORRECT patterns that catch the common mistakes.
113
113
114
114
-**Full Control**: Complete customization over authentication flow
115
-
-**Server Functions**: Secure authentication logic on the server
116
-
-**Session Management**: Built-in session handling with HTTP-only cookies
115
+
-**Server Primitives**: Sessions, OAuth, CSRF, rate limiting — see [Authentication Server Primitives](./authentication-server-primitives.md)
116
+
-**Session Management**: HTTP-only cookies via `setResponseHeader`, read with `getRequestHeader`
117
117
-**Type Safety**: End-to-end type safety for authentication state
118
118
119
119
### 🌐 Other Excellent Options
@@ -226,6 +226,7 @@ Build your own authentication system using TanStack Start's server functions and
226
226
227
227
**Implementation Guides:**
228
228
229
+
-[Authentication Server Primitives](./authentication-server-primitives.md) — sessions, cookies, OAuth, CSRF, rate limiting (the server half)
0 commit comments