Phauxth v1.0.3 Phauxth.Config View Source
This module provides an abstraction layer for configuration.
The following are valid configuration items.
name | type | default |
---|---|---|
log_level | atom | :info |
drop_user_keys | list of atoms | [] |
endpoint | module | N/A |
token_salt | string | N/A |
Umbrella apps
A namespaced app name is required in the apps/my_app_name/config/config.exs
file
when Phauxth is used in an Umbrella project, where multiple apps
are using the library.
This because in Umbrella projects the children apps configurations are merged together and the conflicting keys overridden, so we need to namespace every Phauxth configuration to avoid the override and to be able to retrieving the correct peculiar values for each child application.
Examples
With a regular app, add a phauxth
entry to the config.exs
file in your project, as in the following example.
config :phauxth,
token_salt: "YkLmt7+f",
endpoint: MyAppWeb.Endpoint,
log_level: :warn,
drop_user_keys: [:shoe_size]
Here is an example of a namespaced entry (part of an umbrella app):
config :phauxth_my_app_name,
token_salt: "YkLmt7+f",
endpoint: MyAppName.Endpoint
Link to this section Summary
Functions
The keys that are removed from the user struct before it is passed on to another function
The endpoint of your app
Generate a random salt for use with token authentication
The log level for Phauxth logs
The salt to be used when creating and verifying tokens
Link to this section Functions
The keys that are removed from the user struct before it is passed on to another function.
This should be a list of atoms.
By default, :password_hash, :password and :otp_secret are removed, and this option allows you to add to this list.
The endpoint of your app.
This is used by the Phauxth.Confirm module.
Generate a random salt for use with token authentication.
The log level for Phauxth logs.
This should either be an atom, :debug, :info, :warn or :error, or false.
The default is :info, which means that :info, :warn and :error logs will be returned.
The salt to be used when creating and verifying tokens.
This is used by the Phauxth.Authenticate module, if you are using token authentication, and by the Phauxth.Confirm module.