Phauxth v0.12.1-rc.0 Phauxth.Confirm.Login View Source
A custom login function which also checks to see if the user’s account has been confirmed yet.
Link to this section Summary
Functions
If confirmed_at: nil
is in the user struct, this function will return
{:error, message}. Otherwise, it will run the default check_pass
function
Verify a user’s password
Link to this section Functions
If confirmed_at: nil
is in the user struct, this function will return
{:error, message}. Otherwise, it will run the default check_pass
function.
Verify a user’s password.
Examples
The example below shows how you can use this function in the create function of a Phoenix session controller:
def create(conn, %{"session" => params}) do
case Phauxth.Login.verify(params, MyApp.Accounts) do
{:ok, user} -> handle_successful_login
{:error, message} -> handle_error
end
end