plug_password v0.3.1 PlugPassword.Block

Plug used to add simple authentication.

Options should be provided with at least passwords field.

Possible options:

  • :passwords - list of passwords that should allow users to pass authentication. Example: [“hello”, “world”]
  • :template - module which implement PlugPassword.Template.Behaviour. Example: MyApp.PlugPassword.Template
  • :path_whitelist - regex which will be used to check if path is whitelisted. Example: ~r/users/
  • :ip_whitelist - list of IPs that should be whitelisted. Example: [“127.0.0.1”]

Link to this section Summary

Functions

Checks if password is matching

Link to this section Functions

Link to this function call(conn, options)

Checks if password is matching.

If password will match or is already set in cookie then it will continue to pipe connection. Otherwise it will render form.