-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow folks to specify a resource for sign-in route. #236
Comments
I'd actually love this for a current project I'm working on. Is there a current workaround for hiding non-desirable resources? I have users with auth and a completely separate set of subscription resources that I use a |
The current workaround is to just role your own liveview for each one - probably just by copypasta'ing the file from this repo. |
Would also love this without having a work around haha. I would be down to try my hand at making this possible, but I'm not sure the best strategy to do so. Would love any guidance on how we'd want to make it work. |
Essentially we'd want to start at the live session level, and take the option and put the value into the live session. Then, when listing authenticated resources we'd check for that option value, and if its not set we'd use the full list. It shouldn't be a significant code change I think. |
Okay, this makes sense, I think for me I'm wondering about path generation for Should we have a different method or we can have a sign_in_route that changes the name_path ie:
which will then return: or we can expand on the How do you see it working? I'm quite junior and I want to make sure I take it in the direction you see :) |
I'll defer to @jimsynz on that front :D |
Okay so firstly I think we should consider leaving the existing So, given that we can introspect a bunch of useful stuff about the resources and their authentication strategies, what would folks prefer to see in their router? This is one idea I had which may or may not be a better alternative. Give me your ideas. auth_ui_for Member, include_strategies: :all | [atom], exclude_strategies: :all | [atom], unify: boolean which could generate routes something like this when
and when it's
Certainly open to lots of feedback as I'd like to solve this once and for all. |
This setup gives flexibility for setting up custom pages. In my experience we do need to provide for different pages to facilitate way-finding and to accommodate (error and succes) feedback. "Pages" in the conceptual sense - it could be facilitated by multipurpose modules like To facilitate discussion, I've created flow diagrams with the expected "pages". |
I've spent some time thinking about how we might support multi-step flows because currently it's not super easy. For example sometimes folks want unconfirmed users to be able to sign in and reduce their access with policies, and sometimes folks want confirmation to be a gate. This is probably a discussion for https://github.com/team-alembic/ash_authentication rather than here, but worth mentioning. Maybe some kind of rule-based system similar to policies? Not sure. |
It can be confusing that the default sign in page will just show two forms if you have two resources with authentication enabled. So we should add a
resources: [Ash.Resource.t]
option tosign_in_route
.Same probably goes for
reset_route
also.The text was updated successfully, but these errors were encountered: