Differences From
Artifact [7ea4ccf2b4]:
1 1 -- vim: ft=terra
2 2 local pstr = lib.mem.ptr(int8)
3 -local P = lib.str.plit
4 3 local terra
5 4 login_form(co: &lib.srv.convo, user: &lib.store.actor, creds: &lib.store.credset, msg: pstr)
6 5 var doc = [lib.srv.convo.page] {
7 - title = lib.str.plit 'instance logon';
8 - class = lib.str.plit 'login';
6 + title = 'instance logon';
7 + class = 'login';
9 8 cache = false;
10 9 }
11 10
12 11 if user == nil then
13 12 var form = data.view.login_username {
14 13 loginmsg = msg;
15 14 }
16 15 if form.loginmsg.ptr == nil then
17 - form.loginmsg = lib.str.plit 'identify yourself for access to this instance.'
16 + form.loginmsg = 'identify yourself for access to this instance.'
18 17 end
19 18 doc.body = form:tostr()
20 19 elseif creds:sz() == 0 then
21 20 co:complain(403,'access denied','your host is not eligible to authenticate as this user')
22 21 return
23 22 elseif creds:sz() == 1 then
24 23 if creds.trust() then
................................................................................
27 26 end
28 27
29 28 var ch = data.view.login_challenge {
30 29 handle = user.handle;
31 30 name = lib.coalesce(user.nym, user.handle);
32 31 }
33 32 if creds.pw() then
34 - ch.challenge = P'enter the password associated with your account'
35 - ch.label = P'password'
36 - ch.method = P'pw'
37 - ch.auto = P'current-password';
33 + ch.challenge = 'enter the password associated with your account'
34 + ch.label = 'password'
35 + ch.method = 'pw'
36 + ch.auto = 'current-password';
38 37 elseif creds.otp() then
39 - ch.challenge = P'enter a valid one-time password for your account'
40 - ch.label = P'OTP code'
41 - ch.method = P'otp'
42 - ch.auto = P'one-time-code';
38 + ch.challenge = 'enter a valid one-time password for your account'
39 + ch.label = 'OTP code'
40 + ch.method = 'otp'
41 + ch.auto = 'one-time-code';
43 42 elseif creds.challenge() then
44 - ch.challenge = P'sign the challenge token: <code>...</code>'
45 - ch.label = P'digest'
46 - ch.method = P'challenge'
47 - ch.auto = P'one-time-code';
43 + ch.challenge = 'sign the challenge token: <code>...</code>'
44 + ch.label = 'digest'
45 + ch.method = 'challenge'
46 + ch.auto = 'one-time-code';
48 47 else
49 48 co:complain(500,'login failure','unknown login method')
50 49 return
51 50 end
52 51
53 52 doc.body = ch:tostr()
54 53 else