2020-05-07 02:14:54 -06:00
|
|
|
# Pleroma: A lightweight social networking server
|
2022-02-25 23:11:42 -07:00
|
|
|
# Copyright © 2017-2022 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
|
2022-02-28 09:07:28 -07:00
|
|
|
alias Pleroma.Web.Gettext
|
2020-06-29 05:39:09 -06: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 02:14:54 -06:00
|
|
|
end
|