-
Notifications
You must be signed in to change notification settings - Fork 0
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
magic link authentication for phx.gen.live #1
base: main
Are you sure you want to change the base?
Conversation
3983d0e
to
5507e43
Compare
|
||
case Accounts.update_user_password(user, password, user_params) do | ||
case Accounts.apply_user_password(user, user_params) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is necessary because we want to disconnect existing LiveView connections when a password is changed (we already invalidate the sessions). This is not happening at the moment, which could be a security risk. The problem with the old setup (changing the password in the LiveView) is that we clear the tokens when changing the password, so this is also the moment where we need to broadcast disconnects for all old sessions. Broadcasting here would break the flow though, because the current LiveView would be disconnected before it has a chance to actually handle the trigger_submit
. Instead of doing a "disconnect everything except me" which would require us to know the session token in the LiveView, we instead move the actual password change mechanism to the controller and only validate here.
903f94b
to
b44b0fc
Compare
adapted tests, but no new tests yet
524594a
to
bc9c3c4
Compare
5724091
to
ebca55d
Compare
b85f90b
to
fe20fb4
Compare
941d18a
to
cbc9da9
Compare
No description provided.