axelb
axelb
AEAsh Elixir
Created by axelb on 1/27/2023 in #support
Display "Wrong credentials" on SignInLive
Done
61 replies
AEAsh Elixir
Created by axelb on 2/4/2023 in #support
Changing SignIn submit button label
Done
28 replies
AEAsh Elixir
Created by axelb on 2/4/2023 in #support
Changing SignIn submit button label
Ok, I will create one ticket for "Functional override" and one ticket "Support localization" if that's ok with you.
28 replies
AEAsh Elixir
Created by maxmannen on 2/7/2023 in #support
Problem with override image
Notice I don't override the same component
6 replies
AEAsh Elixir
Created by maxmannen on 2/7/2023 in #support
Problem with override image
In your case, this worked for me as override module to remove the images:
defmodule ZenvtcWeb.AuthOverrides do
use AshAuthentication.Phoenix.Overrides
alias AshAuthentication.Phoenix.Components

override Components.Banner do
set :image_url, nil
set :dark_image_url, nil
end
end
defmodule ZenvtcWeb.AuthOverrides do
use AshAuthentication.Phoenix.Overrides
alias AshAuthentication.Phoenix.Components

override Components.Banner do
set :image_url, nil
set :dark_image_url, nil
end
end
6 replies
AEAsh Elixir
Created by maxmannen on 2/7/2023 in #support
Problem with override image
6 replies
AEAsh Elixir
Created by maxmannen on 2/7/2023 in #support
Problem with override image
Hi, The default override gathers all the possible overrides and can serve as a reference: https://github.com/team-alembic/ash_authentication_phoenix/blob/main/lib/ash_authentication_phoenix/overrides/default.ex
6 replies
AEAsh Elixir
Created by axelb on 2/4/2023 in #support
Changing SignIn submit button label
I see, thank you for clarifying. You're right: If we put the code you posted in a function name_from_atom and the text is
button_text = action.display_name || name_from_atom(action)
button_text = action.display_name || name_from_atom(action)
it's awkward because the default "humanized atom" is smarter than the provided display name... I would give the "Sign In With Pasword" a shorter (ironic, I know) display name "Se connecter" and it would solve my problem, but it definitely feels hackish and a loss of relevant info.
28 replies
AEAsh Elixir
Created by axelb on 2/4/2023 in #support
Changing SignIn submit button label
I see 3 possible mechanisms for customization: 1. Action atom name turned into something readable is what we have now in several extensions and I think it's cool for rapid development. 2. Resource level display name for actions and attributes would allow to adjust the UI in the whole app with a single code change, no need to change every atom in the codebase. You can provide more info and detailed names to the app users without coupling the code to the UX considerations. 3. Overrides for customizing precise parts of the UI when you want to get fancy, with as many code change as UI changes, they make a lot of sense to for classes or funny messages. Ash provides 1, and 3 for a given set of changes. I am convinced 2 would be useful too, even with more customization options in 3. I made heavy use of the feature in Django, for what it's worth. Thanks for your time Zach, curious to hear your thoughts on this.
28 replies
AEAsh Elixir
Created by axelb on 2/4/2023 in #support
Changing SignIn submit button label
Wouldn't the override have to be reimplemented for each extension (AshAdmin and AshAuthentication for example) while specifying the name at resource level could be done only once for all usages?
28 replies
AEAsh Elixir
Created by axelb on 2/4/2023 in #support
Changing SignIn submit button label
Thanks for your help guys. I had discarded gettext as not well supported (yet) and overkill for a single-language website. I might end up using it, though, as well as ex_cldr for dates, currencies... What do you think of a verbose_name or display_name in the action and attribute DSLs to control the display? When specified, it could be used the humanize(action.name) in this instance, or for example to_name(attribute.name) in AshAdmin.
28 replies
AEAsh Elixir
Created by axelb on 2/2/2023 in #support
postgres function undefined
Oh, thanks. I just couldn't see it. 😅
4 replies
AEAsh Elixir
Created by axelb on 1/27/2023 in #support
Display "Wrong credentials" on SignInLive
Agree that a flash is fine for those cases that don't involve forms 👍
61 replies
AEAsh Elixir
Created by axelb on 1/27/2023 in #support
Display "Wrong credentials" on SignInLive
Yeah, I've mostly played with password auth so far, so I'm speaking from this incomplete perspective.
61 replies
AEAsh Elixir
Created by axelb on 1/27/2023 in #support
Display "Wrong credentials" on SignInLive
Thanks for the reply, here are some thoughts gathered over the weekend. I think the flash message is not "local enough" and makes for less clear feedback and not great UX. This is why I would favor integrating the feedback in the SignInLive component. This way, we can get clear messages mapping to the _reason of failure, right next to the forms. Hopefully, the messages will be easy to override and internationalize. This is important to me at least. This brings the following considerations for the AuthController: if LiveView intercepts failure, the role of the failure function is unclear. I think it will be confusing if it is called only in "some" cases of failure. Will it ever be called, in fact? You know more about the usage of the failure function in the wild, but in my experience, 90+% of auth failure, render to the sign in form again, with some error message. No redirect is performed until validation passes and auth succeeds. So I think validation in LiveView and dropping failure function could be both convenient and lead to least surprise for devs (assuming things like rate and retry limiting, last connection, and such are handled at resource level by AshAuthentication 😁 ). What you think of these points?
61 replies
AEAsh Elixir
Created by axelb on 1/27/2023 in #support
Link directly to "Register" page
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
9 replies