Minor restructuring

This commit is contained in:
n* 2025-03-08 00:07:37 -03:00
parent 5316db3dcb
commit 22cb36a23d
27 changed files with 320 additions and 272 deletions

View file

@ -19,6 +19,14 @@ local errors = {
invalid_token = "invalid authentication, please log back in..."
}
errors.handle = function(data, code, redirect)
data.response.setCookie("error-card", code)
if redirect then
data.response.headers["Location"] = redirect
data.response.code = 302
end
end
package.loaded["./errors"] = errors
return errors