View Source Charon.AuthChallenge.PreSentChallenge (Charon v0.0.3-alpha)

TOTP-challenge for which the answer has been sent to the user by SMS/email. Basically the same as Charon.AuthChallenge.TotpChallenge but with a longer default period (5 minutes).

config

Config

Additional config is required for this module under optional.charon_pre_sent_challenge:

Charon.Config.from_enum(
  ...,
  optional_modules: %{
    charon_pre_sent_challenge: %{
      ...
    }
  }
)

The following configuration options are supported:

  • :send_challenge_callback (required). A function/2 used to send a TOTP code to the user. The user and the code are passed in. Must return :ok or {:error, message}.
  • :period (optional, default 300). The duration in seconds in which a single OTP code is valid.

Link to this section Summary

Link to this section Functions

Callback implementation for Charon.AuthChallenge.name/0.

Link to this function

setup_init(conn, params, user, config)

View Source

Callback implementation for Charon.AuthChallenge.setup_init/4.