Openmaize v2.1.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

    • the default is MyApp.OpenmaizeEcto - the name of the module generated by mix openmaize.gen.ectodb
    • if you implement your own database module, it needs to implement the Openmaize.Database behaviour

Example using Phoenix

Add the following line to the pipeline in the web/router.ex file:

plug Openmaize.Authenticate

Summary

Functions

Authenticate the current user

Callback implementation for c:Plug.init/1

Functions

call(conn, db_module)

Authenticate the current user.

init(opts)

Callback implementation for c:Plug.init/1.