aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/user.ex
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-07 08:14:54 +0000
committerlain <lain@soykaf.club>2020-05-07 08:14:54 +0000
commitf4c2bf0985f3d65d9caa6f02a71c89db9f070fb1 (patch)
treea7f4ece6dcd0a534b464e455fa382d3ebd8f4d07 /lib/pleroma/user.ex
parent68a126317d7cdd670c8e244319da08ff85639d33 (diff)
parent3d0c567fbc3506770fdac5f1269c45b244928747 (diff)
downloadpleroma-f4c2bf0985f3d65d9caa6f02a71c89db9f070fb1.tar.gz
Merge branch 'issue/209' into 'develop'
[#209] 2FA/two_factor_authentication support See merge request pleroma/pleroma!801
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r--lib/pleroma/user.ex8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 323eb2a41..a6f51f0be 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -20,6 +20,7 @@ defmodule Pleroma.User do
alias Pleroma.Formatter
alias Pleroma.HTML
alias Pleroma.Keys
+ alias Pleroma.MFA
alias Pleroma.Notification
alias Pleroma.Object
alias Pleroma.Registration
@@ -190,6 +191,12 @@ defmodule Pleroma.User do
# `:subscribers` is deprecated (replaced with `subscriber_users` relation)
field(:subscribers, {:array, :string}, default: [])
+ embeds_one(
+ :multi_factor_authentication_settings,
+ MFA.Settings,
+ on_replace: :delete
+ )
+
timestamps()
end
@@ -927,6 +934,7 @@ defmodule Pleroma.User do
end
end
+ @spec get_by_nickname(String.t()) :: User.t() | nil
def get_by_nickname(nickname) do
Repo.get_by(User, nickname: nickname) ||
if Regex.match?(~r(@#{Pleroma.Web.Endpoint.host()})i, nickname) do