equal
deleted
inserted
replaced
32 return k |
32 return k |
33 end |
33 end |
34 end) |
34 end) |
35 end |
35 end |
36 |
36 |
37 function generate_page(event) |
37 function generate_page(event, token) |
38 local request, response = event.request, event.response; |
38 local request, response = event.request, event.response; |
39 |
39 |
40 local tokens = invite_storage:get() or {}; |
40 local tokens = invite_storage:get() or {}; |
41 |
|
42 local token = request.path:match("^/invite/([^/]*)$"); |
|
43 |
41 |
44 response.headers.content_type = "text/html; charset=utf-8"; |
42 response.headers.content_type = "text/html; charset=utf-8"; |
45 |
43 |
46 if not token or not tokens[token] then |
44 if not token or not tokens[token] then |
47 local template = assert(module:load_resource("invite/invite_result.html")):read("*a"); |
45 local template = assert(module:load_resource("invite/invite_result.html")):read("*a"); |