diff options
| author | Ivan Tashkinov <ivant.business@gmail.com> | 2019-04-04 22:41:03 +0300 | 
|---|---|---|
| committer | Ivan Tashkinov <ivant.business@gmail.com> | 2019-04-04 22:41:03 +0300 | 
| commit | f7cd9131d4aa0da3c4c0174acc56ce1bbdbd284c (patch) | |
| tree | 2771cb1735df31b2ef791f3305ee61351853f012 /lib | |
| parent | 37925cbe78b7fc73f28cc85ffcf1e16fb00f7a24 (diff) | |
| download | pleroma-f7cd9131d4aa0da3c4c0174acc56ce1bbdbd284c.tar.gz pleroma-f7cd9131d4aa0da3c4c0174acc56ce1bbdbd284c.zip | |
[#923] OAuth consumer controller tests. Misc. improvements.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pleroma/web/oauth/oauth_controller.ex | 4 | ||||
| -rw-r--r-- | lib/pleroma/web/templates/o_auth/o_auth/register.html.eex | 1 | ||||
| -rw-r--r-- | lib/pleroma/web/templates/o_auth/o_auth/show.html.eex | 2 | 
3 files changed, 6 insertions, 1 deletions
| diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index 1b467e983..2dcaaabc1 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -253,6 +253,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do        auth_params = %{          "client_id" => params["client_id"],          "redirect_uri" => params["redirect_uri"], +        "state" => params["state"],          "scopes" => oauth_scopes(params, nil)        } @@ -289,6 +290,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do      render(conn, "register.html", %{        client_id: params["client_id"],        redirect_uri: params["redirect_uri"], +      state: params["state"],        scopes: oauth_scopes(params, []),        nickname: params["nickname"],        email: params["email"] @@ -313,6 +315,8 @@ defmodule Pleroma.Web.OAuth.OAuthController do        )      else        _ -> +        params = Map.delete(params, "password") +          conn          |> put_flash(:error, "Unknown error, please try again.")          |> redirect(to: o_auth_path(conn, :registration_details, params)) diff --git a/lib/pleroma/web/templates/o_auth/o_auth/register.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/register.html.eex index f4547170c..2e806e5fb 100644 --- a/lib/pleroma/web/templates/o_auth/o_auth/register.html.eex +++ b/lib/pleroma/web/templates/o_auth/o_auth/register.html.eex @@ -44,5 +44,6 @@ please provide the details below.</p>  <%= hidden_input f, :client_id, value: @client_id %>  <%= hidden_input f, :redirect_uri, value: @redirect_uri %>  <%= hidden_input f, :scope, value: Enum.join(@scopes, " ") %> +<%= hidden_input f, :state, value: @state %>  <% end %> diff --git a/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex index e6cf1db45..0144675ab 100644 --- a/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex +++ b/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex @@ -22,7 +22,7 @@  <%= hidden_input f, :client_id, value: @client_id %>  <%= hidden_input f, :response_type, value: @response_type %>  <%= hidden_input f, :redirect_uri, value: @redirect_uri %> -<%= hidden_input f, :state, value: @state%> +<%= hidden_input f, :state, value: @state %>  <%= submit "Authorize" %>  <% end %> | 
