onobard stub

This commit is contained in:
BuckarooBanzay 2023-01-28 20:30:44 +01:00
parent 14464395b5
commit 5fc1459a31
2 changed files with 47 additions and 15 deletions

View file

@ -12,22 +12,8 @@ otp = {
}
dofile(MP.."/functions.lua")
dofile(MP.."/onboard.lua")
if minetest.get_modpath("mtt") and mtt.enabled then
dofile(MP.."/functions.spec.lua")
end
minetest.register_chatcommand("test", {
func = function(name)
local url = "otpauth://totp/abc:myaccount?algorithm=SHA1&digits=6&issuer=abc&period=30&"
.. "secret=N6JGKMEKU2E6HQMLLNMJKBRRGVQ2ZKV7"
local ok, code = otp.qrcode(url)
assert(ok)
local png = otp.create_qr_png(code)
local formspec = "size[10,10]" ..
"image[1,0.6;5,5;^[png:" .. minetest.encode_base64(png) .. "]"
minetest.show_formspec(name, "TEST", formspec)
end
})