forked from AkkomaGang/akkoma
Make token exchange return errors with 400 as status code
This commit is contained in:
parent
73904e8f78
commit
3607dc4558
1 changed files with 6 additions and 2 deletions
|
@ -71,7 +71,9 @@ def token_exchange(conn, %{"grant_type" => "authorization_code"} = params) do
|
||||||
|
|
||||||
json(conn, response)
|
json(conn, response)
|
||||||
else
|
else
|
||||||
_error -> json(conn, %{error: "Invalid credentials"})
|
_error ->
|
||||||
|
put_status(conn, 400)
|
||||||
|
|> json(%{error: "Invalid credentials"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -96,7 +98,9 @@ def token_exchange(
|
||||||
|
|
||||||
json(conn, response)
|
json(conn, response)
|
||||||
else
|
else
|
||||||
_error -> json(conn, %{error: "Invalid credentials"})
|
_error ->
|
||||||
|
put_status(conn, 400)
|
||||||
|
|> json(%{error: "Invalid credentials"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue