March Docs › Forge.GenAuth Forge.GenAuth Forge.GenAuth — forge bastion gen auth
Generates authentication boilerplate for a Bastion web application. Modelled on Phoenix phx.gen.auth — produces ready-to-use files that developers can customise.
Files created: lib/<app>/accounts/user.march lib/<app>/accounts/user_token.march lib/<app>/accounts/user_notifier.march lib/<app>/accounts.march lib/<app>/auth.march lib/<app>/controllers/auth/registration_controller.march lib/<app>/controllers/auth/session_controller.march lib/<app>/controllers/auth/user_settings_controller.march lib/<app>/controllers/auth/confirmation_controller.march priv/depot/migrations/<ts>_create_users.march priv/depot/migrations/<ts+1>_create_user_tokens.march test/support/accounts_fixtures.march
Ported from gen_auth.ml.
Functions fn build_email_token build_email_token(user, context) #
fn build_session_token build_session_token(user) #
fn change_user_password change_user_password(user) #
fn change_user_registration change_user_registration(attrs) #
fn confirm_user confirm_user(token_str) #
fn create_session_token create_session_token(user) #
fn create_session_token create_session_token(user) #
fn current_user current_user(conn) #
fn delete_session_token delete_session_token(token) #
fn deliver_confirmation_instructions deliver_confirmation_instructions(user, confirmation_url) #
fn deliver_reset_password_instructions deliver_reset_password_instructions(user, reset_url) #
fn deliver_update_email_instructions deliver_update_email_instructions(user, update_url) #
fn deliver_user_confirmation_instructions deliver_user_confirmation_instructions(user, url_fn) #
fn deliver_user_reset_password_instructions deliver_user_reset_password_instructions(user, url_fn) #
fn deliver_welcome deliver_welcome(user) #
fn get_user_by_email get_user_by_email(email) #
fn get_user_by_email_and_password get_user_by_email_and_password(email, password) #
fn get_user_by_reset_password_token get_user_by_reset_password_token(token_str) #
fn get_user_by_session_token get_user_by_session_token(token) #
fn hash_password hash_password(gate) #
fn redirect_if_authenticated redirect_if_authenticated(conn) #
fn register_user register_user(params) #
fn registration_gate registration_gate(params) #
fn require_authenticated_user require_authenticated_user(conn) #
fn reset_user_password reset_user_password(user, params) #
Generate auth boilerplate in the current project directory.
fn update_email update_email(conn) #
fn update_email_gate update_email_gate(user, params) #
fn update_password update_password(conn) #
fn update_password_gate update_password_gate(user, params) #
fn update_user_email update_user_email(user, params) #
fn update_user_password update_user_password(user, params) #
fn user_fixture user_fixture(overrides) #
fn user_fixture_attrs user_fixture_attrs(overrides) #
fn valid_password valid_password(user, password) #