Phauxth.Login (Phauxth v2.5.1) View Source

Module to login users.

Before using this module, you will need to add the crypto_module value to the config. The crypto_module must implement the Comeonin behaviour.

Options

There are two options:

  • :user_context - the user_context module
    • this can also be set in the config
  • :log_meta - additional custom metadata for Phauxth.Log
    • this should be a keyword list

There are also options for verifying the password. See the documentation for the check_pass function for details.

Link to this section Summary

Functions

Checks the password, using the crypto_module's verify_pass/2, by comparing the hash with the password hash found in a user struct, or map.

Link to this section Functions

Link to this function

check_pass(user, password, opts \\ [])

View Source

Checks the password, using the crypto_module's verify_pass/2, by comparing the hash with the password hash found in a user struct, or map.

This is a convenience function that takes a user struct, or map, as input and seamlessly handles the cases where no user is found.

Options

  • :hash_key - the password hash identifier
    • this does not need to be set if the key is :password_hash or :encrypted_password
  • :hide_user - run the no_user_verify/1 function if no user is found
    • the default is true