Openmaize v2.0.0 Openmaize.Authenticate
Authenticate the current user, using sessions.
Options
There is one option:
db_module - the module that is used to query the database
- in most cases, this will be generated by
mix openmaize.gen.ectodb
and will be called MyApp.OpenmaizeEcto - if you implement your own database module, it needs to implement the Openmaize.Database behaviour
- in most cases, this will be generated by
Example using Phoenix
Add the following line to the pipeline in the web/router.ex
file:
plug Openmaize.Authenticate, db_module: MyApp.OpenmaizeEcto