Mercurial Hosting > chat
diff src/do_login.html.luan @ 5:a49866b52cc2
login to chat
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Tue, 29 Oct 2024 13:10:47 -0600 |
| parents | 2c63b10781e1 |
| children | 5a56297713a3 |
line wrap: on
line diff
--- a/src/do_login.html.luan Sun Oct 27 20:39:18 2024 -0600 +++ b/src/do_login.html.luan Tue Oct 29 13:10:47 2024 -0600 @@ -1,11 +1,16 @@ local Luan = require "luan:Luan.luan" local error = Luan.error +local ipairs = Luan.ipairs or error() +local Table = require "luan:Table.luan" +local concat = Table.concat or error() local Io = require "luan:Io.luan" local Http = require "luan:http/Http.luan" local Shared = require "site:/lib/Shared.luan" local head = Shared.head or error() local header = Shared.header or error() local User = require "site:/lib/User.luan" +local Utils = require "site:/lib/Utils.luan" +local to_list = Utils.to_list or error() return function() @@ -28,8 +33,20 @@ <% else user.login() + local with = Http.request.parameters.with + local location + if with == nil then + location = "/" + else + with = to_list(with) + local t = {} + for _, email in ipairs(with) do + t[#t+1] = "with="..email + end + location = "/chat.html?"..concat(t,"&") + end %> - <script> location = '/'; </script> + <script> location = '<%=location%>'; </script> <% end %>
