aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/oauth/token/response.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-05-08 21:37:55 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-05-08 21:37:55 +0300
commitb2924ab1fbba4e6add15030cf8444d2d3f0cfe0c (patch)
tree000420341c4397cb7e380ff6fa52bb023700476a /lib/pleroma/web/oauth/token/response.ex
parentd5cdc907e3fda14c2ce78ddbb124739441330ecc (diff)
parent570940a3fd8d5a2fb600656432dfc01304161221 (diff)
downloadpleroma-b2924ab1fbba4e6add15030cf8444d2d3f0cfe0c.tar.gz
Merge remote-tracking branch 'remotes/origin/develop' into restricted-relations-embedding
Diffstat (limited to 'lib/pleroma/web/oauth/token/response.ex')
-rw-r--r--lib/pleroma/web/oauth/token/response.ex9
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