diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-06-11 22:54:39 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-06-11 22:54:48 +0200 |
commit | 40970f6bb94760d19cc1d3201405df5bb32f5083 (patch) | |
tree | 6331de242c3b36d615d5f12ec9e3324708a308ab /lib/mix | |
parent | 7aa6c82937090ca6f2298dee0ef894954ca2f129 (diff) | |
download | pleroma-40970f6bb94760d19cc1d3201405df5bb32f5083.tar.gz |
New mix task: pleroma.user reset_mfa <nickname>
Diffstat (limited to 'lib/mix')
-rw-r--r-- | lib/mix/tasks/pleroma/user.ex | 12 |
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() |