fix(apps): fix typo in redirect_uri parameter
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
fa16537290
commit
5664625c1c
|
@ -41,3 +41,4 @@ FE1EEB91EA633570F703B251AE2D4D4E
|
|||
E7967805C1EA5301F2722C7BDB2F25F3
|
||||
BDFB0FB1AAF69C18212CBCFD42F8B717
|
||||
40220A533CCACB3A1CE9DBF1A8A430A1
|
||||
EEB29D1DDA3A3015BC645A989B5BD38E
|
|
@ -13,7 +13,7 @@ defmodule Mobilizon.Web.ApplicationController do
|
|||
@spec create_application(Plug.Conn.t(), map()) :: Plug.Conn.t()
|
||||
def create_application(
|
||||
conn,
|
||||
%{"name" => name, "redirect_uris" => redirect_uris, "scope" => scope} = args
|
||||
%{"name" => name, "redirect_uri" => redirect_uris, "scope" => scope} = args
|
||||
) do
|
||||
ip = conn.remote_ip |> :inet.ntoa() |> to_string()
|
||||
|
||||
|
@ -33,7 +33,9 @@ defmodule Mobilizon.Web.ApplicationController do
|
|||
conn
|
||||
|> Plug.Conn.put_resp_header("cache-control", "no-store")
|
||||
|> json(
|
||||
Map.take(app, [:name, :website, :redirect_uris, :client_id, :client_secret, :scope])
|
||||
app
|
||||
|> Map.take([:name, :website, :client_id, :client_secret, :scope])
|
||||
|> Map.put(:redirect_uri, app.redirect_uris)
|
||||
)
|
||||
|
||||
{:error, :invalid_scope} ->
|
||||
|
|
|
@ -24,7 +24,7 @@ defmodule Mobilizon.Web.ApplicationControllerTest do
|
|||
conn
|
||||
|> post("/apps", %{
|
||||
"name" => "hello",
|
||||
"redirect_uris" => "hello",
|
||||
"redirect_uri" => "hello",
|
||||
"scope" => "write nothing"
|
||||
})
|
||||
|
||||
|
@ -46,14 +46,14 @@ defmodule Mobilizon.Web.ApplicationControllerTest do
|
|||
conn
|
||||
|> post("/apps", %{
|
||||
"name" => name,
|
||||
"redirect_uris" => Enum.join(redirect_uris, "\n"),
|
||||
"redirect_uri" => Enum.join(redirect_uris, "\n"),
|
||||
"scope" => scope,
|
||||
"website" => website
|
||||
})
|
||||
|
||||
assert %{
|
||||
"name" => ^name,
|
||||
"redirect_uris" => ^redirect_uris,
|
||||
"redirect_uri" => ^redirect_uris,
|
||||
"scope" => ^scope,
|
||||
"website" => ^website,
|
||||
"client_id" => _client_id,
|
||||
|
|
Loading…
Reference in a new issue