OAuth consumer: tests fix, comments, Keycloak config notes.

This commit is contained in:
Ivan Tashkinov 2019-06-05 13:02:13 +03:00
commit 3eefb274f4
4 changed files with 36 additions and 3 deletions

View file

@ -17,6 +17,8 @@ defmodule Pleroma.Web.OAuth.OAuthController do
alias Pleroma.Web.OAuth.Token.Strategy.Revoke, as: RevokeToken
alias Pleroma.Web.OAuth.Scopes
require Logger
if Pleroma.Config.oauth_consumer_enabled?(), do: plug(Ueberauth)
plug(:fetch_session)
@ -318,7 +320,9 @@ defmodule Pleroma.Web.OAuth.OAuthController do
|> registration_details(%{"authorization" => registration_params})
end
else
_ ->
error ->
Logger.debug(inspect(["OAUTH_ERROR", error, conn.assigns]))
conn
|> put_flash(:error, "Failed to set up user account.")
|> redirect(external: redirect_uri(conn, params["redirect_uri"]))