mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-29 16:24:58 +00:00
21 lines
553 B
Lua
21 lines
553 B
Lua
local validate = require("validate")
|
|
local M = {}
|
|
|
|
function M.handleLogin(form)
|
|
local result = validate.login(form)
|
|
if not result.valid then
|
|
return { success = false, errors = result.errors }
|
|
end
|
|
return { success = true, action = "login", username = form.username }
|
|
end
|
|
|
|
function M.handleRegister(form)
|
|
local result = validate.register(form)
|
|
if not result.valid then
|
|
return { success = false, errors = result.errors }
|
|
end
|
|
return { success = true, action = "register", username = form.username, email = form.email }
|
|
end
|
|
|
|
return M
|