Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1011 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 1011 Bytes

PlugPassword

Build Status

Simple authentication plug based on rack_password. Similary it will ask you for password only once and store it in your cookie (not like basic auth).

Hex.pm package HexDocs

Installation

The package can be installed by adding plug_password to your list of dependencies in mix.exs:

def deps do
  [
    {:plug_password, "~> 0.3.0"}
  ]
end

then plug it before your router:

plug PlugPassword.Block, passwords: ["hello", world],
  template: Authentication,
  path_whitelist: ~r/users/,
  ip_whitelist: ["86.123.112.78"],
  custom_rule: &Authentication.custom_rule/1

plug PlugPasswordTestWeb.Router

check possible options to pass to plug in HexDocs.