logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 6bbd65fb0922c5e7ed4877968c3c92ff51cc12cb
parent 608017b7df5916b607e707627dc09d89599129ff
Author: rinpatch <rinpatch@sdf.org>
Date:   Thu, 10 Sep 2020 18:38:48 +0000

Merge branch '2130-mfa-users-oauth-login-fix' into 'develop'

[#2130] Fixed OAuth OOB authentication for users with enabled MFA

Closes #2130

See merge request pleroma/pleroma!2979

Diffstat:

Mlib/pleroma/web/oauth/oauth_controller.ex5++++-
Mlib/pleroma/web/templates/o_auth/o_auth/oob_authorization_created.html.eex2+-
Mlib/pleroma/web/templates/o_auth/o_auth/oob_token_exists.html.eex2+-
3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex @@ -145,7 +145,10 @@ defmodule Pleroma.Web.OAuth.OAuthController do def after_create_authorization(%Plug.Conn{} = conn, %Authorization{} = auth, %{ "authorization" => %{"redirect_uri" => @oob_token_redirect_uri} }) do - render(conn, "oob_authorization_created.html", %{auth: auth}) + # Enforcing the view to reuse the template when calling from other controllers + conn + |> put_view(OAuthView) + |> render("oob_authorization_created.html", %{auth: auth}) end def after_create_authorization(%Plug.Conn{} = conn, %Authorization{} = auth, %{ diff --git a/lib/pleroma/web/templates/o_auth/o_auth/oob_authorization_created.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/oob_authorization_created.html.eex @@ -1,2 +1,2 @@ <h1>Successfully authorized</h1> -<h2>Token code is <%= @auth.token %></h2> +<h2>Token code is <br><%= @auth.token %></h2> diff --git a/lib/pleroma/web/templates/o_auth/o_auth/oob_token_exists.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/oob_token_exists.html.eex @@ -1,2 +1,2 @@ <h1>Authorization exists</h1> -<h2>Access token is <%= @token.token %></h2> +<h2>Access token is <br><%= @token.token %></h2>