aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-06-11 22:54:39 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-06-11 22:54:48 +0200
commit40970f6bb94760d19cc1d3201405df5bb32f5083 (patch)
tree6331de242c3b36d615d5f12ec9e3324708a308ab /lib/mix/tasks
parent7aa6c82937090ca6f2298dee0ef894954ca2f129 (diff)
downloadpleroma-40970f6bb94760d19cc1d3201405df5bb32f5083.tar.gz
New mix task: pleroma.user reset_mfa <nickname>
Diffstat (limited to 'lib/mix/tasks')
-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()