56
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
|
3 local Parsers = require "luan:Parsers.luan"
|
|
4 local json_string = Parsers.json_string or error()
|
|
5 local Http = require "luan:http/Http.luan"
|
|
6 local Io = require "luan:Io.luan"
|
|
7 local User = require "site:/lib/User.luan"
|
|
8 local get_user_by_email = User.get_by_email or error()
|
|
9
|
|
10
|
|
11 return function()
|
|
12 local email = Http.request.parameters.email or error()
|
|
13 Io.stdout = Http.response.text_writer()
|
|
14 if get_user_by_email(email) ~= nil then
|
|
15 %>
|
59
|
16 location = 'chat?with=<%=email%>';
|
56
|
17 <%
|
|
18 return
|
|
19 end
|
|
20 %>
|
|
21 openInvite(<%=json_string(email)%>);
|
|
22 <%
|
|
23 end
|