diff options
author | lain <lain@soykaf.club> | 2020-07-09 13:10:05 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-09 13:10:05 +0000 |
commit | 8ca1f3e8c61b906387e9cb6fb8993d2ad496ab3d (patch) | |
tree | bbacb00a4ef2ae1a1c79b87ebf036baea3e4e6cc /lib/pleroma/web/oauth/mfa_controller.ex | |
parent | f4469dc7419288a46512ea5cae6ffe32de5d47c2 (diff) | |
parent | 59540131c189afb10faf98d1bfeccf8f94985a90 (diff) | |
download | pleroma-8ca1f3e8c61b906387e9cb6fb8993d2ad496ab3d.tar.gz |
Merge branch '1723-token-fixes' into 'develop'
AccountController: Return scope in proper format.
Closes #1723
See merge request pleroma/pleroma!2694
Diffstat (limited to 'lib/pleroma/web/oauth/mfa_controller.ex')
-rw-r--r-- | lib/pleroma/web/oauth/mfa_controller.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/oauth/mfa_controller.ex b/lib/pleroma/web/oauth/mfa_controller.ex index 53e19f82e..f102c93e7 100644 --- a/lib/pleroma/web/oauth/mfa_controller.ex +++ b/lib/pleroma/web/oauth/mfa_controller.ex @@ -13,6 +13,7 @@ defmodule Pleroma.Web.OAuth.MFAController do alias Pleroma.Web.Auth.TOTPAuthenticator alias Pleroma.Web.OAuth.MFAView, as: View alias Pleroma.Web.OAuth.OAuthController + alias Pleroma.Web.OAuth.OAuthView alias Pleroma.Web.OAuth.Token plug(:fetch_session when action in [:show, :verify]) @@ -74,7 +75,7 @@ defmodule Pleroma.Web.OAuth.MFAController do {:ok, %{user: user, authorization: auth}} <- MFA.Token.validate(mfa_token), {:ok, _} <- validates_challenge(user, params), {:ok, token} <- Token.exchange_token(app, auth) do - json(conn, Token.Response.build(user, token)) + json(conn, OAuthView.render("token.json", %{user: user, token: token})) else _error -> conn |