authority v0.1.0 Authority.Registration behaviour
A behaviour for registering and updating users.
Usage
defmodule MyApp.Accounts.Registration do
use Authority.Registration
@impl Authority.Registration
def create_user(params) do
# Create a user
end
@impl Authority.Registration
def get_user(id) do
# Get a user by ID
end
@impl Authority.Registration
def update_user(user, params) do
# Update the user
end
@impl Authority.Registration
def delete_user(user) do
# Delete the user
end
end
Link to this section Summary
Types
An error returned from creating/updating/deleting a user
Parameters needed to create a user. For example,
A user. Can be any type that represents a user for your application
Link to this section Types
An error returned from creating/updating/deleting a user.
Parameters needed to create a user. For example,
%{
email: "my@email.com",
password: "password",
password_confirmation: "password"
}
A user. Can be any type that represents a user for your application.
Link to this section Callbacks
Creates a user.
Deletes a user.
Gets a user by ID.
Link to this callback
update_user(user, params)
Updates a user.