2020-05-07 08:14:54 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
2021-01-13 06:49:20 +00:00
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
2020-05-07 08:14:54 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Web.OAuth.MFAView do
|
|
|
|
use Pleroma.Web, :view
|
|
|
|
import Phoenix.HTML.Form
|
2020-06-29 11:39:09 +00:00
|
|
|
alias Pleroma.MFA
|
2022-02-28 16:07:28 +00:00
|
|
|
alias Pleroma.Web.Gettext
|
2020-06-29 11:39:09 +00:00
|
|
|
|
|
|
|
def render("mfa_response.json", %{token: token, user: user}) do
|
|
|
|
%{
|
|
|
|
error: "mfa_required",
|
|
|
|
mfa_token: token.token,
|
|
|
|
supported_challenge_types: MFA.supported_methods(user)
|
|
|
|
}
|
|
|
|
end
|
2020-05-07 08:14:54 +00:00
|
|
|
end
|