# Haytni

Haytni is a configurable authentication system for Phoenix, inspired by Devise and `mix phx.gen.auth`

(end) goals:

* security focused
* provides a strong and ready to use base
* non-bloatware:
  + all logics are not located in controllers
  + minimize changes on upgrades
* easily customisable and extendable:
  + enable (or disable) any plugin
  + add your own plugins to the stack

The only things you install in your project are:

* migrations
* views (you may need some custom helpers for your templates)
* templates (for emails and web pages)

If you need your own features, you write (and test) your own plugins:

* no need to change some obscur and very long code you may not understand, you just need to implement the callbacks that feet your needs
* your changes will not impact and break anything else (starting by tests)


* [authenticable]( (`Haytni.AuthenticablePlugin`): handles hashing and storing an encrypted password in the database
* [registerable]( (`Haytni.RegisterablePlugin`): the elements to create a new account or edit its own account
* [rememberable]( (`Haytni.RememberablePlugin`): provides "persistent" authentication (the "remember me" feature)
* [confirmable]( (`Haytni.ConfirmablePlugin`): accounts have to be validated by email
* [recoverable]( (`Haytni.RecoverablePlugin`): recover for a forgotten password
* [lockable]( (`Haytni.LockablePlugin`): automatic lock an account after a number of failed attempts to sign in
* [trackable]( (`Haytni.TrackablePlugin`): register users's connections (IP + when)
* [invitable]( (`Haytni.InvitablePlugin`): registration on invitation or sponsorship
* [liveview]( (`Haytni.LiveViewPlugin`): provides authentication to channels and liveview if the *\_csrf\_token* cookie is not available
* [clearsitedata]( (`Haytni.ClearSiteDataPlugin`): set the HTTP header Clear-Site-Data on logout (and eventually login)

Documentation can be found at [](

Installation is described [here](

**BEWARE**: this README (and the whole master branch) might be out of sync with hexdocs (last release)