logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

settings.ex (659B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.MFA.Settings do
  5. use Ecto.Schema
  6. @primary_key false
  7. @mfa_methods [:totp]
  8. embedded_schema do
  9. field(:enabled, :boolean, default: false)
  10. field(:backup_codes, {:array, :string}, default: [])
  11. embeds_one :totp, TOTP, on_replace: :delete, primary_key: false do
  12. field(:secret, :string)
  13. # app | sms
  14. field(:delivery_type, :string, default: "app")
  15. field(:confirmed, :boolean, default: false)
  16. end
  17. end
  18. def mfa_methods, do: @mfa_methods
  19. end