diff --git a/apps/andi/assets/css/app.scss b/apps/andi/assets/css/app.scss index 596d1c71c..0ffd070fc 100644 --- a/apps/andi/assets/css/app.scss +++ b/apps/andi/assets/css/app.scss @@ -152,6 +152,7 @@ body { } @import "./access-groups.scss"; +@import "./autherror.scss"; @import "./button.scss"; @import "./data_dictionary_form.scss"; @import "./datasets.scss"; diff --git a/apps/andi/assets/css/autherror.scss b/apps/andi/assets/css/autherror.scss new file mode 100644 index 000000000..57a4c1fda --- /dev/null +++ b/apps/andi/assets/css/autherror.scss @@ -0,0 +1,19 @@ +.autherror-view { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: rgb(88, 95, 99); + height: 100vh; + width: 100vw; +} + +.autherror-inner-content { + background: $color-content-background; + box-shadow: $box-shadow; + height: max-content; + width: max-content; + margin: 1em; + padding: 2em; + border-radius: 6px; +} \ No newline at end of file diff --git a/apps/andi/lib/andi_web/controllers/auth_controller.ex b/apps/andi/lib/andi_web/controllers/auth_controller.ex index 7f6e86a71..d4569ec40 100644 --- a/apps/andi/lib/andi_web/controllers/auth_controller.ex +++ b/apps/andi/lib/andi_web/controllers/auth_controller.ex @@ -21,7 +21,7 @@ defmodule AndiWeb.AuthController do Logger.error("Failed to retrieve auth credentials: #{inspect(fails)} with params #{inspect(params)}") conn - |> redirect(to: "/") + |> redirect(to: "/autherror") end def callback(%{assigns: %{ueberauth_auth: auth}} = conn, _params) do diff --git a/apps/andi/lib/andi_web/live/error_live_view/error_live_view.ex b/apps/andi/lib/andi_web/live/error_live_view/error_live_view.ex new file mode 100644 index 000000000..25feb0cab --- /dev/null +++ b/apps/andi/lib/andi_web/live/error_live_view/error_live_view.ex @@ -0,0 +1,23 @@ +defmodule AndiWeb.ErrorLiveView do + use AndiWeb, :live_view + + access_levels(render: [:public, :private]) + + def render(assigns) do + ~L""" +
+
+
+

Login Unsuccessful

+

You do not have permission to access this system.

+ Click here to return to login +
+
+
+ """ + end + + def mount(_params, socket) do + {:ok, socket} + end +end diff --git a/apps/andi/lib/andi_web/router.ex b/apps/andi/lib/andi_web/router.ex index 8dd375324..8e43ad72b 100644 --- a/apps/andi/lib/andi_web/router.ex +++ b/apps/andi/lib/andi_web/router.ex @@ -106,4 +106,9 @@ defmodule AndiWeb.Router do scope "/", AndiWeb do get "/healthcheck", HealthCheckController, :index end + + scope "/", AndiWeb do + pipe_through :browser + live "/autherror", ErrorLiveView, layout: {AndiWeb.LayoutView, :app} + end end diff --git a/apps/andi/mix.exs b/apps/andi/mix.exs index e4549e6f6..692d127aa 100644 --- a/apps/andi/mix.exs +++ b/apps/andi/mix.exs @@ -4,7 +4,7 @@ defmodule Andi.MixProject do def project do [ app: :andi, - version: "2.6.62", + version: "2.6.63", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps",