Ash FrameworkAF
Ash Framework6mo ago
5 replies
Igor Barakaiev

Redirect on successful authentication

This seems like a trivial issue but I can't seem to figure out how to do it. Suppose:

1. A user clicks the account button in the navbar but is currently logged out.
2. Ash authentication helpers redirect them to /sign-in.
3. They log in successfully.

How can I prevent the user from being redirected to / and instead redirect them to /account which the user was originally trying to access? More generally, if a user is trying to access a protected resources (e.g. /post/:post_id which they own), how can I redirect them to that same URL as well upon successful login? Thanks so much in advance!
Was this page helpful?