Mercurial Hosting > chat
comparison src/login.js.luan @ 44:1aa50739475a
add manual login
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Thu, 27 Feb 2025 22:50:46 -0700 |
| parents | 9f45d32670ae |
| children | e138343b2c76 |
comparison
equal
deleted
inserted
replaced
| 43:89d3ddd302c7 | 44:1aa50739475a |
|---|---|
| 12 | 12 |
| 13 | 13 |
| 14 return function() | 14 return function() |
| 15 local email = Http.request.parameters.email or error() | 15 local email = Http.request.parameters.email or error() |
| 16 local user = User.get_or_create_by_email(email) | 16 local user = User.get_or_create_by_email(email) |
| 17 local url = base_url().."/do_login.html?user="..user.id.."&password="..user.password | 17 local password = user.password |
| 18 local url = base_url().."/do_login.html?user="..user.id.."&password="..password | |
| 18 local with = Http.request.parameters.with | 19 local with = Http.request.parameters.with |
| 19 with = to_list(with) | 20 with = to_list(with) |
| 20 for _, email in ipairs(with) do | 21 for _, email in ipairs(with) do |
| 21 url = url.."&with="..email | 22 url = url.."&with="..email |
| 22 end | 23 end |
| 26 Subject = "Login" | 27 Subject = "Login" |
| 27 body = `%> | 28 body = `%> |
| 28 Here is the link to login: | 29 Here is the link to login: |
| 29 | 30 |
| 30 <%= url %> | 31 <%= url %> |
| 32 | |
| 33 Or login with your email and the password: <%=password%> | |
| 31 <% ` | 34 <% ` |
| 32 } | 35 } |
| 33 Io.stdout = Http.response.text_writer() | 36 Io.stdout = Http.response.text_writer() |
| 34 %> | 37 %> |
| 35 location = '/login_sent.html'; | 38 location = '/login_sent.html'; |
