diff options
author | Maksim <parallel588@gmail.com> | 2020-05-07 08:14:54 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-07 08:14:54 +0000 |
commit | 3d0c567fbc3506770fdac5f1269c45b244928747 (patch) | |
tree | a7f4ece6dcd0a534b464e455fa382d3ebd8f4d07 /lib/pleroma/web/oauth/token/response.ex | |
parent | 68a126317d7cdd670c8e244319da08ff85639d33 (diff) | |
download | pleroma-3d0c567fbc3506770fdac5f1269c45b244928747.tar.gz |
Pleroma.Web.TwitterAPI.TwoFactorAuthenticationController -> Pleroma.Web.PleromaAPI.TwoFactorAuthenticationController
Diffstat (limited to 'lib/pleroma/web/oauth/token/response.ex')
-rw-r--r-- | lib/pleroma/web/oauth/token/response.ex | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/pleroma/web/oauth/token/response.ex b/lib/pleroma/web/oauth/token/response.ex index 6f4713dee..0e72c31e9 100644 --- a/lib/pleroma/web/oauth/token/response.ex +++ b/lib/pleroma/web/oauth/token/response.ex @@ -5,6 +5,7 @@ defmodule Pleroma.Web.OAuth.Token.Response do @moduledoc false + alias Pleroma.MFA alias Pleroma.User alias Pleroma.Web.OAuth.Token.Utils @@ -32,5 +33,13 @@ defmodule Pleroma.Web.OAuth.Token.Response do } end + def build_for_mfa_token(user, mfa_token) do + %{ + error: "mfa_required", + mfa_token: mfa_token.token, + supported_challenge_types: MFA.supported_methods(user) + } + end + defp expires_in, do: Pleroma.Config.get([:oauth2, :token_expires_in], 600) end |