doorman v0.4.0 Doorman
Provides authentication helpers that take advantage of the options configured in your config files.
Summary
Functions
Authenticates a user by their email and password. Returns the user if the user is found and the password is correct, otherwise nil
Authenticates a user. Returns true if the user’s password and the given password match based on the strategy configured, otherwise false
Returns true if passed in conn
s assigns
has a non-nil :current_user
,
otherwise returns false
Functions
Authenticates a user by their email and password. Returns the user if the user is found and the password is correct, otherwise nil.
Requires user_module
, secure_with
, and repo
to be configured via
Mix.Config
. See [README.md] for an example.
Doorman.authenticate("joe@dirt.com", "brandyr00lz")
Authenticates a user. Returns true if the user’s password and the given password match based on the strategy configured, otherwise false.
Use authenticate/2
if if you would to authenticate by email and password.
Requires user_module
, secure_with
, and repo
to be configured via
Mix.Config
. See [README.md] for an example.
user = Myapp.Repo.get(Myapp.User, 1)
Doorman.authenticate_user(user, "brandyr00lz")