AE
Ash Elixir•3y ago
axelb

Link directly to "Register" page

Does the AshAuthentication.Phoenix router provide a link to open directly the "Register" part of the "/sign-in" route? All I could do is open the "sign in", and then click on "Need an account?" link, which doesn't change the URL in the navbar.
7 Replies
ZachDaniel
ZachDaniel•3y ago
Great question. We should probably make that use a different route, and patch to that route when the button is clicked 👍
jart
jart•3y ago
At the moment it just uses a toggle. It could definitely be done although it’d take some thinking because of the way the sign in component iterates resources and strategies.
axelb
axelbOP•3y ago
Have you considered doing two separate components for SignIn and SignUp/Register? I am curious to hear your rationale for the "Single component and toggle" way. Here are pros I can think of for two components: - Two routes become natural - Can be customized and reimplemented separately by the Ash user - (Subjectively) that's what I expected approaching the code as a newbie What are your thoughts on cons ? - Iterating resource and strategies must be factored out - Each component should be aware of the other's route so they can link to it
Stefan Wintermeyer
Stefan Wintermeyer•3y ago
I think a separate /register route is very useful. It feels cleaner than the current solution. I don't so much care about the inner workings of that route just that I can send somebody an email with that route to tell him/her how to register a new account.
ZachDaniel
ZachDaniel•3y ago
Yeah, the difficulty isn’t that we don’t think it should have a route, it’s just that we derive each component on the page based on the strategies, so we’ll have to do some reworking to make those use respond to routes. Can we open an issue on the ash_authentication_phoenix repo?
Stefan Wintermeyer
Stefan Wintermeyer•3y ago
GitHub
/register route is missing · Issue #98 · team-alembic/ash_authentic...
There are the routes /sign-in and /sign-out but a /register route is missing. That would be very handy and cleaner from a user's perspective than the current way via the /sign-in route.
ZachDaniel
ZachDaniel•3y ago
I think we should close this for now because we have an open issue, and this will get resolved when that issue is handled. Not much more to say about it aside from that we agree it should be done. PRs welcome ❤️

Did you find this page helpful?