Minor restructuring
This commit is contained in:
parent
5316db3dcb
commit
22cb36a23d
27 changed files with 320 additions and 272 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue