projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Merge branch 'features/hashtag-column' into 'develop'"
[akkoma]
/
lib
/
pleroma
/
web
/
auth
/
totp_authenticator.ex
diff --git
a/lib/pleroma/web/auth/totp_authenticator.ex
b/lib/pleroma/web/auth/totp_authenticator.ex
index 04e489c8398fe14ec33aae4e64772b169c1a41d9..edc9871ea459bae05eb65882e7b28c4a4648bbc0 100644
(file)
--- a/
lib/pleroma/web/auth/totp_authenticator.ex
+++ b/
lib/pleroma/web/auth/totp_authenticator.ex
@@
-1,11
+1,12
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Auth.TOTPAuthenticator do
alias Pleroma.MFA
alias Pleroma.MFA.TOTP
alias Pleroma.User
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Auth.TOTPAuthenticator do
alias Pleroma.MFA
alias Pleroma.MFA.TOTP
alias Pleroma.User
+ alias Pleroma.Web.Plugs.AuthenticationPlug
@doc "Verify code or check backup code."
@spec verify(String.t(), User.t()) ::
@doc "Verify code or check backup code."
@spec verify(String.t(), User.t()) ::
@@
-30,7
+31,7
@@
defmodule Pleroma.Web.Auth.TOTPAuthenticator do
code
)
when is_list(codes) and is_binary(code) do
code
)
when is_list(codes) and is_binary(code) do
- hash_code = Enum.find(codes, fn hash ->
Pbkdf2.verify_pass
(code, hash) end)
+ hash_code = Enum.find(codes, fn hash ->
AuthenticationPlug.checkpw
(code, hash) end)
if hash_code do
MFA.invalidate_backup_code(user, hash_code)
if hash_code do
MFA.invalidate_backup_code(user, hash_code)