Packages

A full featured, configurable authentication and user management system for Phoenix.

Security advisory: This version has known vulnerabilities. View advisories

Current section

Files

Jump to
coherence priv templates coherence.install models coherence user.ex
Raw

priv/templates/coherence.install/models/coherence/user.ex

defmodule <%= user_schema %> do
use <%= base %>.Web, :model
use Coherence.Schema
schema "<%= user_table_name %>" do
field :name, :string
field :email, :string
coherence_schema
timestamps
end
def changeset(model, params \\ %{}) do
model
|> cast(params, [:name, :email] ++ coherence_fields)
|> validate_required([:name, :email])
|> unique_constraint(:email)
|> validate_coherence(params)
end
end