2020-05-07 10:14:54 +02:00
|
|
|
# Pleroma: A lightweight social networking server
|
2021-01-13 07:49:20 +01:00
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
2020-05-07 10:14:54 +02: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 13:39:09 +02:00
|
|
|
alias Pleroma.MFA
|
|
|
|
|
|
|
|
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 10:14:54 +02:00
|
|
|
end
|