Search
Star
Feedback
Setup for Free
ยฉ 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Prevent accessing route if logged in - Ash Framework
AF
Ash Framework
โข
6mo ago
โข
5 replies
Yahya Oxley
Prevent accessing route if logged in
Is it possible to prevent a user from accessing a page if already logged in
?
I remember vanilla Phoenix having something like
:redirect_if_user_authenticated
:redirect_if_user_authenticated
but I can
't find the Ash way to achieve this
.
Solution
You could do it at the router level
, but you could also add a policy on the action
Jump to solution
Ash Framework
Join
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.
2,193
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Maintaining the current logged in user.
AF
Ash Framework / support
4y ago
Testing liveviews requiring users to be logged in.
AF
Ash Framework / support
10mo ago
Can override `sign_in_route`, but not `reset_route` for AshAuthenticationPhoenix
AF
Ash Framework / support
3y ago
How do I make a query require authentication and return an error if the user is not logged in?
AF
Ash Framework / support
6mo ago