[#2130] Fixed OAuth OOB authentication for users with enabled MFA.
authorIvan Tashkinov <ivantashkinov@gmail.com>
Wed, 9 Sep 2020 19:44:38 +0000 (22:44 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Wed, 9 Sep 2020 19:44:38 +0000 (22:44 +0300)
lib/pleroma/web/oauth/oauth_controller.ex
lib/pleroma/web/templates/o_auth/o_auth/oob_authorization_created.html.eex
lib/pleroma/web/templates/o_auth/o_auth/oob_token_exists.html.eex

index dd00600ea5ce3c7e67450e8706b8fdc0fb2f122f..06b116368b637d4c4462e82958346744e425107a 100644 (file)
@@ -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, %{
index 8443d906b5c4cd20c993c0d893d4b912fc766506..ffabe29a624ad85c67cd5e5ab5553bc9dde80cce 100644 (file)
@@ -1,2 +1,2 @@
 <h1>Successfully authorized</h1>
-<h2>Token code is <%= @auth.token %></h2>
+<h2>Token code is <br><%= @auth.token %></h2>
index 961aad976843dba2f3d82084c13a791c0722a8fb..82785c4b99bede3011b23c3e8a44d4b64751bd2a 100644 (file)
@@ -1,2 +1,2 @@
 <h1>Authorization exists</h1>
-<h2>Access token is <%= @token.token %></h2>
+<h2>Access token is <br><%= @token.token %></h2>