Packages
ash_authentication_phoenix
1.8.3
3.0.0-rc.9
3.0.0-rc.8
3.0.0-rc.7
3.0.0-rc.6
3.0.0-rc.4
3.0.0-rc.3
3.0.0-rc.2
3.0.0-rc.1
3.0.0-rc.0
2.17.2
2.17.1
2.17.0
2.16.0
2.15.0
2.14.1
2.14.0
2.13.1
2.13.0
2.12.2
2.12.1
2.12.0
2.11.0
2.10.5
2.10.4
2.10.3
2.10.2
2.10.1
2.10.0
2.9.0
2.8.0
2.7.0
2.6.3
2.6.2
2.6.1
2.6.0
2.5.4
2.5.3
2.5.2
2.5.1
2.5.0
2.4.8
2.4.7
2.4.6
2.4.5
2.4.4
2.4.3
2.4.2
2.4.1
2.4.0
2.3.0
2.2.1
2.2.0
2.1.11
2.1.10
2.1.9
2.1.8
2.1.7
2.1.6
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.1.0
2.0.2
2.0.1
2.0.0
2.0.0-rc.2
2.0.0-rc.1
2.0.0-rc.0
1.9.4
1.9.3
1.9.2
1.9.1
1.9.0
1.8.7
1.8.6
1.8.5
1.8.4
1.8.3
1.8.2
1.8.1
1.8.0
1.7.3
1.7.2
1.7.1
1.7.0
1.6.6
1.6.5
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.1
1.5.0
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.1
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
Phoenix integration for Ash Authentication
Security advisory:
This version has known vulnerabilities.
View advisories
Current section
Files
Jump to
Current section
Files
lib/ash_authentication_phoenix/overrides/default.ex
defmodule AshAuthentication.Phoenix.Overrides.Default do
@moduledoc """
This is the default overrides for our component UI.
The CSS styles are based on [TailwindCSS](https://tailwindcss.com/).
"""
use AshAuthentication.Phoenix.Overrides
alias AshAuthentication.Phoenix.{Components, ResetLive, SignInLive}
override SignInLive do
set :root_class, "grid h-screen place-items-center dark:bg-gray-900"
end
override ResetLive do
set :root_class, "grid h-screen place-items-center dark:bg-gray-900"
end
override Components.Reset do
set :root_class, """
flex-1 flex flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none
lg:px-20 xl:px-24
"""
set :strategy_class, "mx-auth w-full max-w-sm lg:w-96"
end
override Components.Reset.Form do
set :root_class, nil
set :label_class, "mt-2 mb-4 text-2xl tracking-tight font-bold text-gray-900 dark:text-white"
set :form_class, nil
set :spacer_class, "py-1"
set :disable_button_text, "Changing password ..."
end
override Components.SignIn do
set :root_class, """
flex-1 flex flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none
lg:px-20 xl:px-24
"""
set :strategy_class, "mx-auth w-full max-w-sm lg:w-96"
set :authentication_error_container_class, "text-black dark:text-white text-center"
set :authentication_error_text_class, ""
end
override Components.Banner do
set :root_class, "w-full flex justify-center py-2"
set :href_class, nil
set :href_url, "/"
set :image_class, "block dark:hidden"
set :dark_image_class, "hidden dark:block"
set :image_url, "https://ash-hq.org/images/ash-framework-light.png"
set :dark_image_url, "https://ash-hq.org/images/ash-framework-dark.png"
set :text_class, nil
set :text, nil
end
override Components.HorizontalRule do
set :root_class, "relative my-2"
set :hr_outer_class, "absolute inset-0 flex items-center"
set :hr_inner_class, "w-full border-t border-gray-300 dark:border-gray-700"
set :text_outer_class, "relative flex justify-center text-sm"
set :text_inner_class,
"px-2 bg-white text-gray-400 font-medium dark:bg-gray-900 dark:text-gray-500"
set :text, "or"
end
override Components.MagicLink do
set :root_class, "mt-4 mb-4"
set :label_class, "mt-2 mb-4 text-2xl tracking-tight font-bold text-gray-900 dark:text-white"
set :form_class, nil
set :request_flash_text,
"If this user exists in our database you will contacted with a sign-in link shortly."
set :disable_button_text, "Requesting ..."
end
override Components.Password do
set :root_class, "mt-4 mb-4"
set :interstitial_class, "flex flex-row justify-between content-between text-sm font-medium"
set :toggler_class, "flex-none text-blue-500 hover:text-blue-600 px-2 first:pl-0 last:pr-0"
set :sign_in_toggle_text, "Already have an account?"
set :register_toggle_text, "Need an account?"
set :reset_toggle_text, "Forgot your password?"
set :show_first, :sign_in
set :hide_class, "hidden"
end
override Components.Password.SignInForm do
set :root_class, nil
set :label_class, "mt-2 mb-4 text-2xl tracking-tight font-bold text-gray-900 dark:text-white"
set :form_class, nil
set :slot_class, "my-4"
set :disable_button_text, "Signing in ..."
end
override Components.Password.RegisterForm do
set :root_class, nil
set :label_class, "mt-2 mb-4 text-2xl tracking-tight font-bold text-gray-900 dark:text-white"
set :form_class, nil
set :slot_class, "my-4"
set :disable_button_text, "Registering ..."
end
override Components.Password.ResetForm do
set :root_class, nil
set :label_class, "mt-2 mb-4 text-2xl tracking-tight font-bold text-gray-900 dark:text-white"
set :form_class, nil
set :slot_class, "my-4"
set :reset_flash_text,
"If this user exists in our system, you will be contacted with reset instructions shortly."
set :disable_button_text, "Requesting ..."
end
override Components.Password.Input do
set :field_class, "mt-2 mb-2 dark:text-white"
set :label_class, "block text-sm font-medium text-gray-700 mb-1 dark:text-white"
set :input_class, """
appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md
shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-pale-500
focus:border-blue-pale-500 sm:text-sm dark:text-black
"""
set :input_class_with_error, """
appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md
shadow-sm placeholder-gray-400 focus:outline-none border-red-400 sm:text-sm
dark:text-black
"""
set :submit_class, """
w-full flex justify-center py-2 px-4 border border-transparent rounded-md
shadow-sm text-sm font-medium text-white bg-blue-500 hover:bg-blue-600
focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
mt-4 mb-4
"""
set :error_ul, "text-red-400 font-light my-3 italic text-sm"
set :error_li, nil
set :input_debounce, 350
end
override Components.OAuth2 do
set :root_class, "w-full mt-2 mb-4"
set :link_class, """
w-full flex justify-center py-2 px-4 border border-transparent rounded-md
shadow-sm text-sm font-medium text-black bg-gray-200 hover:bg-gray-300
focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
inline-flex items-center
"""
set :icon_class, "-ml-0.4 mr-2 h-4 w-4"
end
end