diff options
author | Ivan Tashkinov <ivant.business@gmail.com> | 2019-04-05 15:12:02 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivant.business@gmail.com> | 2019-04-05 15:12:02 +0300 |
commit | 47a236f7537ad4366d07361d184c84f3912648f1 (patch) | |
tree | bb6b10c2c712f4e06f129537d9747e6087987b8b /lib/pleroma/web/oauth/fallback_controller.ex | |
parent | 3e7f2bfc2f4769af3cedea3126fa0b3cab3f2b7b (diff) | |
download | pleroma-47a236f7537ad4366d07361d184c84f3912648f1.tar.gz |
[#923] OAuth consumer mode refactoring, new tests, tests adjustments, readme.
Diffstat (limited to 'lib/pleroma/web/oauth/fallback_controller.ex')
-rw-r--r-- | lib/pleroma/web/oauth/fallback_controller.ex | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/pleroma/web/oauth/fallback_controller.ex b/lib/pleroma/web/oauth/fallback_controller.ex index f0fe3b578..afaa00242 100644 --- a/lib/pleroma/web/oauth/fallback_controller.ex +++ b/lib/pleroma/web/oauth/fallback_controller.ex @@ -6,8 +6,21 @@ defmodule Pleroma.Web.OAuth.FallbackController do use Pleroma.Web, :controller alias Pleroma.Web.OAuth.OAuthController - # No user/password - def call(conn, _) do + def call(conn, {:register, :generic_error}) do + conn + |> put_status(:internal_server_error) + |> put_flash(:error, "Unknown error, please check the details and try again.") + |> OAuthController.registration_details(conn.params) + end + + def call(conn, {:register, _error}) do + conn + |> put_status(:unauthorized) + |> put_flash(:error, "Invalid Username/Password") + |> OAuthController.registration_details(conn.params) + end + + def call(conn, _error) do conn |> put_status(:unauthorized) |> put_flash(:error, "Invalid Username/Password") |