fediauth/qrencode.spec.lua

13 lines
327 B
Lua
Raw Normal View History

2023-01-28 16:49:12 +00:00
mtt.register("otp.qrcode", function(callback)
assert(type(otp.qrcode) == "function")
2023-01-28 16:54:36 +00:00
local url = "otpauth://totp/abc:myaccount?algorithm=SHA1&digits=6&issuer=abc&period=30&"
.. "secret=N6JGKMEKU2E6HQMLLNMJKBRRGVQ2ZKV7"
local ok, code = otp.qrcode(url)
assert(ok)
assert(code)
2023-01-28 16:49:12 +00:00
callback()
end)