How to reuse auth code for directory based routing #4229
Answered
by
RMHonor
nirav-blitzm
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
RMHonor
May 22, 2025
Replies: 1 comment 1 reply
-
The pathless route can be a directory, this is what I do src/routes
|── _auth
│ ├── faq
│ │ ├── route.tsx
│ ├── help
│ │ ├── route.tsx
│ ├── dashboard.tsx
│ ├── route.tsx // auth logic lives here
|── login.tsx
|── index.tsx Or you can use the src/routes
|── _auth.faq
│ ├── route.tsx
│── _auth.help
│ ├── route.tsx
│── _auth.dashboard.tsx
│── _auth.tsx // auth logic lives here
|── login.tsx
|── index.tsx |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nirav-blitzm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The pathless route can be a directory, this is what I do
Or you can use the
_auth
prefix on your directories: