aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/pleroma/user.ex
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-06-12 18:25:29 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-06-12 18:25:29 +0400
commit697cf920249b4f67bcc49aa923374d5fdc20809b (patch)
treeee8630240ae99d32279c6a66aea0a51e2b3f406c /lib/mix/tasks/pleroma/user.ex
parent2419776e192316cefbdbe607306c9b92ec558319 (diff)
parente557265a037caa0fd4ab35c811d19ad07a5f53fa (diff)
downloadpleroma-697cf920249b4f67bcc49aa923374d5fdc20809b.tar.gz
Merge remote-tracking branch 'origin/develop' into merge-ogp-twitter-parsers
Diffstat (limited to 'lib/mix/tasks/pleroma/user.ex')
-rw-r--r--lib/mix/tasks/pleroma/user.ex12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex
index 3635c02bc..bca7e87bf 100644
--- a/lib/mix/tasks/pleroma/user.ex
+++ b/lib/mix/tasks/pleroma/user.ex
@@ -144,6 +144,18 @@ defmodule Mix.Tasks.Pleroma.User do
end
end
+ def run(["reset_mfa", nickname]) do
+ start_pleroma()
+
+ with %User{local: true} = user <- User.get_cached_by_nickname(nickname),
+ {:ok, _token} <- Pleroma.MFA.disable(user) do
+ shell_info("Multi-Factor Authentication disabled for #{user.nickname}")
+ else
+ _ ->
+ shell_error("No local user #{nickname}")
+ end
+ end
+
def run(["deactivate", nickname]) do
start_pleroma()