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