March Docs

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

fnbuild_email_tokenbuild_email_token(user, context)#
fnbuild_session_tokenbuild_session_token(user)#
fnchange_user_passwordchange_user_password(user)#
fnchange_user_registrationchange_user_registration(attrs)#
fnconfirmconfirm(conn)#
fnconfirm_userconfirm_user(token_str)#
fncreatecreate(conn)#
fncreatecreate(conn)#
fncreatecreate(conn)#
fncreate_session_tokencreate_session_token(user)#
fncreate_session_tokencreate_session_token(user)#
fncurrent_usercurrent_user(conn)#
fndeletedelete(conn)#
fndelete_session_tokendelete_session_token(token)#
fndeliver_confirmation_instructionsdeliver_confirmation_instructions(user, confirmation_url)#
fndeliver_reset_password_instructionsdeliver_reset_password_instructions(user, reset_url)#
fndeliver_update_email_instructionsdeliver_update_email_instructions(user, update_url)#
fndeliver_user_confirmation_instructionsdeliver_user_confirmation_instructions(user, url_fn)#
fndeliver_user_reset_password_instructionsdeliver_user_reset_password_instructions(user, url_fn)#
fndeliver_welcomedeliver_welcome(user)#
fndowndown()#
fndowndown()#
fneditedit(conn)#
fneditedit(conn)#
fnget_userget_user(id)#
fnget_user_by_emailget_user_by_email(email)#
fnget_user_by_email_and_passwordget_user_by_email_and_password(email, password)#
fnget_user_by_reset_password_tokenget_user_by_reset_password_token(token_str)#
fnget_user_by_session_tokenget_user_by_session_token(token)#
fnhash_passwordhash_password(gate)#
fnmainmain(_cap_console : Cap(IO.Console), _cap_clock : Cap(IO.Clock), _cap_filewrite : Cap(IO.FileWrite), _cap_process : Cap(IO.Process))#
fnnewnew(conn)#
fnnewnew(conn)#
fnnewnew(conn)#
fnredirect_if_authenticatedredirect_if_authenticated(conn)#
fnregister_userregister_user(params)#
fnregistration_gateregistration_gate(params)#
fnrequire_authenticated_userrequire_authenticated_user(conn)#
fnresendresend(conn)#
fnreset_user_passwordreset_user_password(user, params)#
fnrunrun()#

Generate auth boilerplate in the current project directory.

fnschemaschema()#
fnschemaschema()#
fnupup()#
fnupup()#
fnupdateupdate(conn)#
fnupdate_emailupdate_email(conn)#
fnupdate_email_gateupdate_email_gate(user, params)#
fnupdate_passwordupdate_password(conn)#
fnupdate_password_gateupdate_password_gate(user, params)#
fnupdate_user_emailupdate_user_email(user, params)#
fnupdate_user_passwordupdate_user_password(user, params)#
fnuser_fixtureuser_fixture(overrides)#
fnuser_fixture_attrsuser_fixture_attrs(overrides)#
fnvalid_passwordvalid_password(user, password)#
fnversionversion()#
fnversionversion()#