Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
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