Pleroma Authenticator: Also update passwords here.
This commit is contained in:
parent
bfdd90f6d7
commit
8bfd9710ae
2 changed files with 9 additions and 3 deletions
|
|
@ -16,7 +16,8 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticator do
|
|||
def get_user(%Plug.Conn{} = conn) do
|
||||
with {:ok, {name, password}} <- fetch_credentials(conn),
|
||||
{_, %User{} = user} <- {:user, fetch_user(name)},
|
||||
{_, true} <- {:checkpw, AuthenticationPlug.checkpw(password, user.password_hash)} do
|
||||
{_, true} <- {:checkpw, AuthenticationPlug.checkpw(password, user.password_hash)},
|
||||
{:ok, user} <- AuthenticationPlug.maybe_update_password(user, password) do
|
||||
{:ok, user}
|
||||
else
|
||||
{:error, _reason} = error -> error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue