Openmaize v1.0.0-beta.5 Openmaize.OnetimePass

Module to handle one-time passwords for use in two factor authentication.

There are two options:

  • 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
  • add_jwt - the function used to add the JSON Web Token to the response

    • the default is &OpenmaizeJWT.Plug.add_token/5

Summary

Functions

Handle the one-time password POST request

Callback implementation for c:Plug.init/1

Functions

call(conn, arg)

Handle the one-time password POST request.

If the one-time password check is successful, a JSON Web Token will be added to the conn, either in a cookie or in the body of the response. The conn is then returned.

init(opts)

Callback implementation for c:Plug.init/1.