Veil v0.2.4 mix veil.add View Source

Veil - simple passwordless authentication for your Phoenix apps.

This installer will do the following:

  • Append the :veil configuration to your config/config.exs file.
  • Generate the Veil.User, Veil.Request and Veil.Session schemas in lib/yourapp/veil/
  • Generate an Ecto migration for these schemas in priv/repo/migrations/
  • Generate controllers, views, plugs and templates in lib/yourapp_web/[type]/veil
  • If this is a new phoenix app using the default template, modify it to include a sign in link

Examples

# Default installation
mix veil.add

Link to this section Summary

Functions

Amend the default layout file to add a Sign-in link in the top right. Do nothing if the app is an api

Set up the config map

Add the app name to config

Add the main paths of the application to config

Adds salts for the request/session internal tokens. These should only ever be saved in the database, so do not actually need to be this random

Uses Mix.Generator to copy the file across, evaluating against the binding

Create directory and copy list of files across

Copies the files in the main directory over, and evaluates against EEx using the config

Copy the migration to the priv/repo/migrations folder

Copies the templates in the web directory over (only if html)

Copies the files in the web directory over, and evaluates against EEx using the config

A task needs to implement run which receives a list of command line args

Gives the source path to copy files from

Verify the paths all exist

Link to this section Functions

Link to this function amend_default_template(config) View Source

Amend the default layout file to add a Sign-in link in the top right. Do nothing if the app is an api.

Link to this function append_config_file(config) View Source

Set up the config map

Add the app name to config

Add the main paths of the application to config

Adds salts for the request/session internal tokens. These should only ever be saved in the database, so do not actually need to be this random.

Link to this function copy_file_evaluate(filename, source_dir, target_dir, binding) View Source

Uses Mix.Generator to copy the file across, evaluating against the binding

Link to this function copy_files(files, source_dir, target_dir, config) View Source

Create directory and copy list of files across

Copies the files in the main directory over, and evaluates against EEx using the config

Copy the migration to the priv/repo/migrations folder

Copies the templates in the web directory over (only if html)

Copies the files in the web directory over, and evaluates against EEx using the config

A task needs to implement run which receives a list of command line args.

Callback implementation for Mix.Task.run/1.

Gives the source path to copy files from

Verify the paths all exist