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