logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma

totp_test.exs (422B)


  1. defmodule Pleroma.MFA.TOTPTest do
  2. use Pleroma.DataCase
  3. alias Pleroma.MFA.TOTP
  4. test "create provisioning_uri to generate qrcode" do
  5. uri =
  6. TOTP.provisioning_uri("test-secrcet", "test@example.com",
  7. issuer: "Plerome-42",
  8. digits: 8,
  9. period: 60
  10. )
  11. assert uri ==
  12. "otpauth://totp/test@example.com?digits=8&issuer=Plerome-42&period=60&secret=test-secrcet"
  13. end
  14. end