Packages

Provides a full user authentication experience for an API. Includes login,logout,register,forgot password, forgot username, confirmation email and all that other good stuff. Includes plug for checking for authenticated users and macro for generating the required routes.

Current section

Files

Jump to
access_pass priv repo migrations example_migration.exs
Raw

priv/repo/migrations/example_migration.exs

defmodule AccessPass.Repo.Migrations.AddUsers do
use Ecto.Migration
def change do
create table(:users, primary_key: false) do
add :user_id, :string, primary_key: true
add :username, :string, size: 20
add :meta, :map
add :email, :string
add :password_hash, :string
add :successful_login_attempts, :integer
add :confirm_id, :string
add :password_reset_key, :string
add :password_reset_expire, :integer
add :confirmed, :boolean
timestamps
end
create unique_index(:users, [:email])
create unique_index(:users, [:user_id])
create unique_index(:users, [:username])
end
end