[#923] OAuth consumer controller tests. Misc. improvements.
This commit is contained in:
parent
37925cbe78
commit
f7cd9131d4
5 changed files with 344 additions and 8 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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 %>
|
||||
|
|
|
|||
|
|
@ -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 %>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue