View Source Plausible.Auth.TOTP.RecoveryCode (Plausible v0.0.1)

Schema for TOTP recovery codes.

Summary

Functions

Generates count unique recovery codes, each alphanumeric and 10 characters long.

Types

@type t() :: %Plausible.Auth.TOTP.RecoveryCode{
  __meta__: term(),
  code_digest: term(),
  id: term(),
  inserted_at: term(),
  user: term(),
  user_id: term()
}

Functions

@spec changeset(Plausible.Auth.User.t(), String.t()) :: Ecto.Changeset.t()
Link to this function

changeset_to_map(changeset, now)

View Source
@spec changeset_to_map(Ecto.Changeset.t(), NaiveDateTime.t()) :: map()
@spec generate_codes(non_neg_integer()) :: [String.t()]

Generates count unique recovery codes, each alphanumeric and 10 characters long.

Link to this function

match?(recovery_code, input_code)

View Source
@spec match?(t(), String.t()) :: boolean()