fix: cath all rauthy errors
This commit is contained in:
parent
df8c6a1854
commit
cbe05c5ca8
1 changed files with 6 additions and 0 deletions
|
|
@ -78,6 +78,12 @@ defmodule MvWeb.AuthController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Catch-all clause for any other error types
|
||||||
|
defp handle_rauthy_failure(conn, reason) do
|
||||||
|
Logger.warning("Unhandled Rauthy failure reason: #{inspect(reason)}")
|
||||||
|
redirect_with_error(conn, gettext("Unable to authenticate with OIDC. Please try again."))
|
||||||
|
end
|
||||||
|
|
||||||
# Handle generic AuthenticationFailed errors
|
# Handle generic AuthenticationFailed errors
|
||||||
defp handle_authentication_failed(conn, %Ash.Error.Forbidden{errors: errors}) do
|
defp handle_authentication_failed(conn, %Ash.Error.Forbidden{errors: errors}) do
|
||||||
if Enum.any?(errors, &match?(%AshAuthentication.Errors.CannotConfirmUnconfirmedUser{}, &1)) do
|
if Enum.any?(errors, &match?(%AshAuthentication.Errors.CannotConfirmUnconfirmedUser{}, &1)) do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue