redirect screen while trying to sign-in with wrong email or password
Why does this screen comes up instead of displaying an error message that the credentials are not right.

36 Replies
🤔 Is your form set up to submit the action?
set up to submit the action over a controller route, I mean
At the moment, the behavior is to submit over HTTP to log you in, which means that you'd need to, in your AuthController, redirect on failure
This is what
ash_hq
does
these are the current settings of the login form
now it redirects to the same page but doesn't show the error message 😅
So you need to add some code to your page/layout to render flash messages
There is a guide for that in phoenix/phoenix liveview I'm sure 🙂
Yeah i know. I already have the flash messages setup
Thanks
🤔 so its not showing the flash messages you're setting?
It started working itself now.
Thank you @Zach Daniel ❤️
👍
@Zach Daniel can you tell me one thing?
I was looking into the auth forms and there is one
reset_form
as well.
but there is not link or route to access thatCorrect, it switches not on a route
It does it using liveview state
there is a discussion about that here: https://discord.com/channels/711271361523351632/1068488089514811432
If you want to do it with a separate route you can 🙂
reset password?
Yeah, works the same way
You can serve it over a different route if you want, just make another liveview for it
I thought that reset_form is for resetting the password
yes, it is
Its for requesting a forgotten password
then how can i access it? 😅
like requesting an email with a password reset link
You're writing your own liveview...
So you can access it however you want. I'm not sure I understand.
yes i used my own liveviews for registeration and login
You'll need to write your own liveview for password reset too
My concern was what strategy is being used there
like i can access the default sign-in page through
localhost:4000/sign-in
. I was wondering if there is any way to access that one as wellThere is no route for password reset currently. I think that will change because of issues like the one I linked where people want to link directly to those pages
but for now, you can't link to something like
/forgot-password
Because it doesn't have its own route
But thats with the default built in stuff
if you're writing your own liveview, you can do :magic_sparkles: whatever you wantNoted. Can you tell me what strategy is being used there? 😅
so i can implement that in my own liveviews?
What do you mean what strategy?
like sign-in page have this strategy:
Thats the same strategy
I mean: that is the strategy for all of the forms around passwords
I didn't realize you meant the actual
AshAuthentication.Strategy
Have you configured your strategy to be resettable
?but here the
resettable
is empty list
no? 😅
how can i do that?
thats what I have in
ash_hq
Take a look at the docs and search for resettablei did search and found nothing
Found 2 DSL results in ash_authentication:
* resettable: http://ash-hq.org/docs/dsl/ash_authentication/3.7.3/authentication/authentication/strategies/password/resettable
* Authentication: http://ash-hq.org/docs/dsl/ash_authentication/3.7.3/authentication
Ooh, that's a cool command! 😄
🙂 I need to make a private version of it so it will respond not to everyone in the chat
I was about to say that @frankdugan3
We're going to be making the DSL docs much better soon
but anyway, you can configure it the way I've shown
AshHq.Accounts.User.Senders.SendPasswordResetEmail
This is another module using swoosh or something to send email?GitHub
GitHub - ash-project/ash_hq: The Ash Framework homepage and documen...
The Ash Framework homepage and documentation site. - GitHub - ash-project/ash_hq: The Ash Framework homepage and documentation site.
You can see all of the source code of ash_hq there
So you can take a look at it and see what it does 🙂
Noted with Thanks