aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/auth
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-18 18:38:32 +0200
committerlain <lain@soykaf.club>2020-05-18 18:38:32 +0200
commit0d417e005d5ef89f982866ee09559aef24e36a85 (patch)
tree1381e8f6dbe63ab3a0f61562672a3cf2d69d7f65 /lib/pleroma/web/auth
parentbaf051a59e8bfcb2e55b5e28e46e80d6961b9bb4 (diff)
parent8e9c939e42b7d649d58ce91465086751031b13c8 (diff)
downloadpleroma-0d417e005d5ef89f982866ee09559aef24e36a85.tar.gz
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'lib/pleroma/web/auth')
-rw-r--r--lib/pleroma/web/auth/pleroma_authenticator.ex3
-rw-r--r--lib/pleroma/web/auth/totp_authenticator.ex2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/web/auth/pleroma_authenticator.ex b/lib/pleroma/web/auth/pleroma_authenticator.ex
index a8f554aa3..200ca03dc 100644
--- a/lib/pleroma/web/auth/pleroma_authenticator.ex
+++ b/lib/pleroma/web/auth/pleroma_authenticator.ex
@@ -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
diff --git a/lib/pleroma/web/auth/totp_authenticator.ex b/lib/pleroma/web/auth/totp_authenticator.ex
index ce8a76219..1794e407c 100644
--- a/lib/pleroma/web/auth/totp_authenticator.ex
+++ b/lib/pleroma/web/auth/totp_authenticator.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Auth.TOTPAuthenticator do