Coherence v0.1.3 Mix.Tasks.Coherence.Install
Configure the Coherence User Model for your Phoenix application. Coherence is composed of a number of modules that can be enabled with this installer.
This installer will normally do the following unless given an option not to do so:
- Append the :coherence configuration to your
config/config.exs
file. - Generate appropriate migration files.
- Generate appropriate view files.
- Generate appropriate template files.
- Generate a
web/coherence_web.ex
file. - Generate a
web/models/user.ex
file if one does not already exist.
Examples
# Install with only the `authenticatable` option
mix coherence.install
# Install all the options except `confirmable` and `invitable`
mix coherence.install --full
# Install all the options except `invitable`
mix coherence.install --full-confirmable
# Install all the options except `confirmable`
mix coherence.install --full-invitable
# Install the `full` options except `lockable` and `trackable`
mix coherence.install --full --no-lockable --no-trackable
Option list
A Coherence configuration will be appended to your config/config.exs
file unless
the --no-config
option is given.
A --model=SomeModule
option can be given to override the default User module.
A --repo=CustomRepo
option can be given to override the default Repo module
A --default
option will include only authenticatable
A --full
option will include options authenticatable
, recoverable
, lockable
, trackable
, unlockable_with_token
, registerable
A --full-confirmable
option will include the --full
options in addition to the --confirmable
option
A --full-invitable
option will include the --full
options in addition to the --invitable
option
An --authenticatable
option provides authentication support to your User model.
A --recoverable
option provides the ability to request a password reset email.
A --lockable
option provides login locking after too many failed login attempts.
An --unlockable-with-token
option provides the ability to request an unlock email.
A --trackable
option provides login count, current login timestamp, current login ip, last login timestamp, last login ip in your User model.
A --confirmable
option provides support for confirmation email before the account can be logged in.
An --invitable
option provides support for invitation emails, allowing the new user to create their account including password creation.
A --registerable
option provide support for new users to register for an accountA
—rememberableoption provide a remember me? check box for persistent logins
A --migration-path
option to set the migration path
A --controllers
option to generate controllers boilerplate (not default)
A --module
option to override the module
Disable Options
--no-config
— Don’t append to yourconfig/config.exs
file.--no-web
— Don’t create thecoherence_web.ex
file.--no-views
— Don’t create theweb/views/coherence/
files.--no-migrations
— Don’t create the migration files.--no-templates
— Don’t create theweb/templates/coherence
files.--no-boilerplate
— Don’t create any of the boilerplate files.--no-models
— Don’t generate the model file.
Summary
Functions
Callback implementation for c:Mix.Task.run/1