comparison src/get_password.html.luan @ 6:a6be8817c05b

move mail_info to config
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 02 Jun 2022 19:18:12 -0600
parents dfc36e7ed22c
children 46f6b69e8b10
comparison
equal deleted inserted replaced
5:a09d8bcdc0f9 6:a6be8817c05b
11 local new_password = Shared.new_password or error() 11 local new_password = Shared.new_password or error()
12 local get_raw_config = Shared.get_raw_config or error() 12 local get_raw_config = Shared.get_raw_config or error()
13 local save_raw_config = Shared.save_raw_config or error() 13 local save_raw_config = Shared.save_raw_config or error()
14 14
15 15
16 local send_mail = Mail.sender{ 16 local mail_info = config.mail_info or error "missing config.mail_info"
17 host = "smtpcorp.com" 17 local send_mail = Mail.sender(mail_info).send
18 username = "smtp@luan.software"
19 password = "luanhost"
20 port = 2525
21 }.send
22 18
23 local function handle(email) 19 local function handle(email)
24 local change = Http.request.parameters.change ~= nil 20 local change = Http.request.parameters.change ~= nil
25 local password = config.users[email] 21 local password = config.users[email]
26 if password == nil or change then 22 if password == nil or change then