How to implement /auth/confirm API route outside of /api root #4120
stefan-girlich
started this conversation in
General
Replies: 1 comment
-
you will soon be able to setup API routes anywhere |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to set up an API route
/auth/confirm
as required by my auth solution (Supabase).I considered and/or tried the following so far:
Setting explicit
apiBase
Causes an SCSS/SASS error without error message when opening my root page and seems like a bad practice in general.
Redirecting from route
Redirecting works,
but query parameters are not retainedand query parameters can be accessed in therequest
object whensearch: true
. Does not seem ideal since I unnecessarily renders the root route (incl. CSS etc.).Redirects via middleware or config
Next.js allows for redirecting via middleware and via config. Does TanStack router feature similar concepts? In this case I could implement the API route in
/api/auth/confirm
and simply redirect from/auth/confirm
- assuming headers and query params are retained.Beta Was this translation helpful? Give feedback.
All reactions