Search
Setup for Free
BA
Better Auth
•
7mo ago
星野みずき
how to redirect to previous page after login
example
: try to go
/dashboard
-
> middleware intercepted
-
> redirect to
/login
-
> login success
-
> redirect to
/dashboard
Better Auth
Join
9,563
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
星
星野みずき
example: try to go /dashboard -> middleware intercepted -> redirect to /login ->...
P
Ping
•
6/15/25, 5:59 AM
In the middleware
, append the path the user was initially requesting to a query param part of the login url
.
In your login page
, upon sign
-up
/in success
, redirect to the URL of the query param
.
星
星野みずき
OP
•
6/15/25, 6:18 AM
set redirect in auth
-client
?
P
Ping
•
6/15/25, 9:42 AM
Something like this for example
.
星
星野みずき
OP
•
6/15/25, 3:12 PM
Thanks
.
Let me try it
Similar Threads
[Issue]: Redirect banned user to a custom page after login in with OAuth (Google)
BA
Better Auth / help
6mo ago
redirect after signout on a protected page
BA
Better Auth / help
9mo ago
Page unresponsive after sign in redirect (Chrome)
BA
Better Auth / help
11mo ago
Redirect to custom error page
BA
Better Auth / help
4mo ago