gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitb37875ccb37875ccident mission 012 part 3: real-Chrome fixes (brand 44 px, identity form width), e2e walk, report, logmreb37875cc/components/home.hl

22.2 KB

  1. // components/home.hl — `/` and `/signin/:rid`: ALL OF IDENT (pieces 1+2, tickets #24 #25;
  2. // CONCEPT.md).
  3. // Signed out: email → a six-digit code by mail → signed in. There is no registration:
  4. // the first right code for an address creates the account with a DEFAULT IDENTITY, then
  5. // this page shows that identity's name fields and says they are optional (Skip).
  6. // Signed in: the account's identities (list, new, edit, delete — never the last one)
  7. // and its time zone (the browser's at the first login; changeable here).
  8. //
  9. // Under `/signin/<rid>` the page belongs to an APP'S LOGIN BUTTON (lib/apps.hl requestOf):
  10. // it names the app, signs in to ident if needed, then asks WHICH IDENTITY the app gets
  11. // (with a single identity it still shows which one, one click) and sends the browser back
  12. // to the app with a one-time code. Managing identities stays on `/`.
  13. //
  14. // Every step takes the server's answer from the CALL (the value form of emit): it rides
  15. // the ack, over the socket or the POST fallback.
  16. parent './main.hl'
  17. import { accountOfSession, setTimeZone, signOutEverywhere } from '../lib/accounts.hl'
  18. import { recordPending, dropPending, signInWithCode } from '../lib/login.hl'
  19. import { identityRows, createIdentity, updateIdentity, deleteIdentity } from '../lib/identities.hl'
  20. import { requestOf, grantRequest } from '../lib/apps.hl'
  21. import { siteName } from '../project.hl'
  22. session = null
  23. rid = null
  24. // 'code' on THE CODE PAGE `/code` and `/signin/<rid>/code` (ident#20; lib/api.hl codePage
  25. // renders this component there, only while the session has a pending code), else null
  26. step = null
  27. onCodePage = step == 'code'
  28. // the pending address, read by codePage from the session and handed in as a param (mission
  29. // 048): read here from the session, hl:web (64527baa) would re-derive it after EVERY face
  30. // that takes the session — after the 5th wrong code it turned null and the code form
  31. // vanished with nothing to click (gate "after 5 wrong tries even the RIGHT code is refused")
  32. pending = null
  33. // where this login lives: the email form, and the code page after "Send me a code"
  34. homeUrl = rid != null ? '/signin/' + rid : '/'
  35. codeUrl = rid != null ? '/signin/' + rid + '/code' : '/code'
  36. me = accountOfSession(session)
  37. signedIn = me != null
  38. // THE APP'S LOGIN REQUEST (null on `/`, or when unknown / expired)
  39. request = rid != null ? requestOf(rid) : null
  40. forApp = request != null
  41. badRequest = rid != null && request == null
  42. appName = request != null ? request.app.name : ''
  43. appOrigin = request != null ? request.origin : ''
  44. forInvite = request != null && request.invite != ''
  45. requestLead = forInvite ? 'You are invited to ' : 'Sign in to '
  46. choosing = forApp && me != null // the identity choice for the app
  47. manage = rid == null && me != null // identities + time zone (only on `/`)
  48. meEmail = me != null ? me.email : ''
  49. timeZone = me != null ? me.timeZone : ''
  50. tzInput = timeZone
  51. identities = me != null ? identityRows(me.id) : []
  52. __title = siteName + (forApp ? ' | sign in to ' + appName : (me != null ? ' | your identities' : ' | sign in'))
  53. // the login steps (a View's `if` takes a member, so each step is one).
  54. // THE CODE STEP IS ITS OWN PAGE (ident#20, creator: "just make a /code where it checks a
  55. // pending code"): "Send me a code" records the address in this browser's session (face
  56. // rememberPending) and goes to `/code`; that page shows the code form for the session's
  57. // pending address (lib/login.hl pendingOf) — so a reload, a second tab or a re-seed keeps it.
  58. pendingEmail = onCodePage && me == null && !badRequest ? pending : null
  59. askEmail = me == null && !badRequest && !onCodePage
  60. askCode = pendingEmail != null
  61. email = ''
  62. sentTo = pendingEmail != null ? pendingEmail : ''
  63. code = ''
  64. message = ''
  65. notice = ''
  66. // THE IDENTITY FORM — new, edit, and right after the first login the default identity
  67. // ("welcome": the names are optional, Skip closes it)
  68. editing = false
  69. welcome = false
  70. notWelcome = true // `if (!welcome)` in a View renders nothing: an `if` takes a member
  71. editId = '' // '' = a new identity, else the identity's id (a UUID)
  72. editHeading = ''
  73. fIdentityName = ''
  74. fNickname = ''
  75. fFirstname = ''
  76. fLastname = ''
  77. fAvatar = ''
  78. hasAvatarPreview = false
  79. avatarPreviewClass = hasAvatarPreview ? 'avatar' : 'avatar hidden'
  80. avatarRemoveClass = hasAvatarPreview ? 'quiet small' : 'quiet small hidden'
  81. View {
  82. identCard {
  83. if (forApp) {
  84. appRequest { id = "apprequest" requestLead strong { id = "appname" appName } " " requestOrigin { id = "apporigin" appOrigin } }
  85. }
  86. if (badRequest) {
  87. h1 { "Login request expired" }
  88. p { id = "badrequest" class = "message" "This login request is unknown or expired. Go back to the app and start the login again." }
  89. }
  90. if (askEmail) {
  91. h1 { "Sign in" }
  92. p { class = "lead" "We mail you a one-time code. There are no passwords, and no sign-up: the first login with an address creates its account." }
  93. form { id = "emailform"
  94. on submit(e) {
  95. e.preventDefault()
  96. emit ask(e)
  97. }
  98. label { "Email"
  99. input { id = "email" name = "email" type = "email" autocomplete = "email" required = "required" value = email on input(e) { emit setEmail(e.target.value) } }
  100. }
  101. button { id = "sendcode" type = "submit" "Send me a code" }
  102. }
  103. }
  104. if (askCode) {
  105. h1 { "Enter your code" }
  106. p { id = "sentto" class = "lead" "We sent a six-digit code to " strong { sentTo } ". It is valid for 10 minutes." }
  107. form { id = "codeform"
  108. on submit(e) {
  109. e.preventDefault()
  110. emit verify(e)
  111. }
  112. label { "One-time code"
  113. input { id = "code" name = "code" autocomplete = "one-time-code" inputmode = "numeric" pattern = "[0-9]{6}" maxlength = "6" required = "required" value = code on input(e) { emit setCode(e.target.value) } }
  114. }
  115. formButtons {
  116. button { id = "verify" type = "submit" "Sign in" }
  117. button { id = "back" type = "button" class = "quiet" "Other address" on click(e) { emit back(e) } }
  118. }
  119. }
  120. }
  121. if (signedIn) {
  122. accountBar {
  123. userEmail { id = "meemail" meEmail }
  124. button { id = "signout" type = "button" class = "quiet small" "Sign out" on click(e) { emit doSignOut(e) } }
  125. button { id = "signoutall" type = "button" class = "quiet small" "Sign out everywhere" on click(e) { emit doSignOutAll(e) } }
  126. }
  127. if (editing) {
  128. form { id = "identityform"
  129. on submit(e) {
  130. e.preventDefault()
  131. emit saveForm(e)
  132. }
  133. h1 { id = "formheading" editHeading }
  134. if (welcome) {
  135. p { id = "welcome" class = "lead" "Your account is ready and has a default identity. All of these fields are " strong { "optional" } " — fill in what you like, or skip it and do it later." }
  136. }
  137. label { "Identity name " fieldHint { "(shown when you pick an identity in an app; optional)" }
  138. input { id = "fidentityname" name = "identityName" maxlength = "60" autocomplete = "off" value = fIdentityName on input(e) { emit setF('identityName', e.target.value) } }
  139. }
  140. label { "Nickname " fieldHint { "(optional)" }
  141. input { id = "fnickname" name = "nickname" maxlength = "60" autocomplete = "nickname" value = fNickname on input(e) { emit setF('nickname', e.target.value) } }
  142. }
  143. label { "First name " fieldHint { "(optional)" }
  144. input { id = "ffirstname" name = "firstname" maxlength = "60" autocomplete = "given-name" value = fFirstname on input(e) { emit setF('firstname', e.target.value) } }
  145. }
  146. label { "Last name " fieldHint { "(optional)" }
  147. input { id = "flastname" name = "lastname" maxlength = "60" autocomplete = "family-name" value = fLastname on input(e) { emit setF('lastname', e.target.value) } }
  148. }
  149. avatarField {
  150. img { id = "avatarpreview" class = avatarPreviewClass src = fAvatar alt = "" width = "48" height = "48" }
  151. label { "Avatar " fieldHint { "(optional; a picture apps can show, e.g. next to your comments)" }
  152. input { id = "favatarfile" type = "file" accept = "image/png,image/jpeg,image/webp,image/gif" }
  153. }
  154. input { id = "favatar" name = "avatar" type = "hidden" value = fAvatar on input(e) { emit setF('avatar', e.target.value) } }
  155. button { id = "avatarremove" type = "button" class = avatarRemoveClass "Remove picture" on click(e) { emit setF('avatar', '') } }
  156. span { id = "avatarnote" class = "avatar-note" }
  157. }
  158. formButtons {
  159. button { id = "saveidentity" type = "submit" "Save" }
  160. if (welcome) { button { id = "skip" type = "button" class = "quiet" "Skip" on click(e) { emit closeForm(e) } } }
  161. if (notWelcome) { button { id = "cancel" type = "button" class = "quiet" "Cancel" on click(e) { emit closeForm(e) } } }
  162. }
  163. }
  164. }
  165. if (choosing) {
  166. section { id = "choosesection"
  167. h1 { "Choose an identity" }
  168. p { class = "lead" "Which identity signs in to " strong { appName } "? The app gets only the identity's short id — no email, no names." }
  169. ul { id = "chooselist"
  170. for (row of identities) {
  171. li { class = "choice"
  172. if (row.hasAvatar) { img { class = "avatar" src = row.avatar alt = "" width = "32" height = "32" } }
  173. identityMain {
  174. identityLabel { row.label }
  175. identityShortId { class = "shortid" row.shortId }
  176. if (row.isDefault) { defaultBadge { "default" } }
  177. identityDetails { row.details }
  178. }
  179. button { type = "button" class = "choose" value = row.id "Continue" on click(e) { emit choose(e.target.value) } }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. if (manage) {
  186. section { id = "identitiessection"
  187. sectionHead {
  188. h1 { "Your identities" }
  189. button { id = "newidentity" type = "button" class = "small" "New identity" on click(e) { emit openNew(e) } }
  190. }
  191. ul { id = "identities"
  192. for (row of identities) {
  193. li { class = "identity"
  194. if (row.hasAvatar) { img { class = "avatar" src = row.avatar alt = "" width = "32" height = "32" } }
  195. identityMain {
  196. identityLabel { row.label }
  197. identityShortId { class = "shortid" row.shortId }
  198. if (row.isDefault) { defaultBadge { "default" } }
  199. identityDetails { row.details }
  200. }
  201. identityActions {
  202. button { type = "button" class = "quiet small edit" value = row.id "Edit" on click(e) { emit openEdit(e.target.value) } }
  203. if (row.canDelete) { button { type = "button" class = "quiet small danger delete" value = row.id "Delete" on click(e) { emit remove(e.target.value) } } }
  204. }
  205. }
  206. }
  207. }
  208. }
  209. section { id = "timezonesection"
  210. h2 { "Time zone" }
  211. p { class = "lead" "Taken from your browser at your first login. Currently " strong { id = "timezone" timeZone } "." }
  212. p { id = "digestnote" class = "lead" "Your daily mail of notifications comes at 17:00 in this time zone." }
  213. form { id = "tzform"
  214. on submit(e) {
  215. e.preventDefault()
  216. emit saveZone(e)
  217. }
  218. label { "Time zone (IANA name, e.g. Europe/Vienna)"
  219. input { id = "tzinput" name = "timeZone" autocomplete = "off" maxlength = "64" required = "required" value = tzInput on input(e) { emit setTz(e.target.value) } }
  220. }
  221. formButtons {
  222. button { id = "savetz" type = "submit" "Save time zone" }
  223. button { id = "browsertz" type = "button" class = "quiet" "Use this browser's" on click(e) { emit useBrowserZone(e) } }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. p { id = "notice" class = "notice" notice }
  230. p { id = "message" class = "message" message }
  231. }
  232. }
  233. on setEmail(v) { email = v }
  234. on setCode(v) { code = v }
  235. on setTz(v) { tzInput = v }
  236. on setF(name, v) {
  237. if (name == 'identityName') { fIdentityName = v }
  238. if (name == 'nickname') { fNickname = v }
  239. if (name == 'firstname') { fFirstname = v }
  240. if (name == 'lastname') { fLastname = v }
  241. if (name == 'avatar') { fAvatar = v hasAvatarPreview = v.trim() != '' }
  242. }
  243. // the browser's own time zone (IANA name) and whether a name is one it knows (`Intl` is a
  244. // browser global of client code, hybriel#18)
  245. browserZone = () => { return Intl.DateTimeFormat().resolvedOptions().timeZone }
  246. knownZone = (v) => { return v == 'UTC' || Intl.supportedValuesOf('timeZone').includes(v) }
  247. // THE CODE REQUEST is a plain POST to /api/code (lib/api.hl), not a face: only an HTTP
  248. // request carries the client IP (X-Client-IP) the per-IP limit counts (mission 010).
  249. // A refusal (400, 429) answers { error } and is shown like every other message.
  250. on ask(e) {
  251. message = ''
  252. res = fetch('/api/code', { method = 'POST' headers = { 'Content-Type' = 'application/json' } body = JSON.stringify({ email = email }) })
  253. r = res != null ? res.json() : null
  254. if (r == null) {
  255. message = 'the server did not answer — try again'
  256. return null
  257. }
  258. if (r.error != null) {
  259. message = r.error
  260. return null
  261. }
  262. // THE SESSION REMEMBERS THE STEP, then the browser goes to the code page. A function
  263. // route gets no session (hybriel#11), so the face records it; it refuses unless a
  264. // code for the address is really waiting.
  265. k = emit server rememberPending(r.email)
  266. if (k == null) {
  267. message = 'the server did not answer — try again'
  268. return null
  269. }
  270. if (k.error != null) {
  271. message = k.error
  272. return null
  273. }
  274. window.location.assign(codeUrl)
  275. }
  276. on verify(e) {
  277. message = ''
  278. r = emit server verifyCode(sentTo, code, browserZone())
  279. if (r == null) {
  280. message = 'the server did not answer — try again'
  281. return null
  282. }
  283. if (r.error != null) {
  284. message = r.error
  285. return null
  286. }
  287. askCode = false
  288. // signed in: the address bar leaves the code page (a reload of /code would go back
  289. // to it anyway — lib/api.hl codePage sends a signed-in browser there)
  290. window.history.replaceState(null, '', homeUrl)
  291. meEmail = r.account.email
  292. timeZone = r.account.timeZone
  293. tzInput = r.account.timeZone
  294. identities = r.identities
  295. signedIn = true
  296. notice = ''
  297. manage = !forApp
  298. choosing = forApp
  299. // stopgap until hybriel#193 (a page's emit does not reach its shell, so the header's user menu would stay stale):
  300. // an existing account reloads the page now, signed in. The FIRST login keeps the welcome form in place and reloads
  301. // when it is saved or skipped (closeForm / saveForm below).
  302. if (!r.created) { window.location.assign(homeUrl) }
  303. // THE FIRST LOGIN: the default identity's names, optional (for an app too: the
  304. // choice follows once the form is saved or skipped)
  305. if (r.created) {
  306. fillForm(r.identities[0])
  307. editHeading = 'Welcome — name your default identity'
  308. welcome = true
  309. notWelcome = false
  310. editing = true
  311. choosing = false
  312. }
  313. }
  314. // THE CHOICE: the server makes (or finds) this identity's id for the app and answers
  315. // the app's return URL with a one-time code — the browser goes there
  316. on choose(id) {
  317. message = ''
  318. notice = ''
  319. r = emit server chooseIdentity(rid, '' + id)
  320. if (r == null) {
  321. message = 'the server did not answer — try again'
  322. return null
  323. }
  324. if (r.error != null) {
  325. message = r.error
  326. return null
  327. }
  328. notice = 'Back to ' + appName + ' …'
  329. window.location.assign(r.url)
  330. }
  331. fillForm = (row) => {
  332. editId = row.id
  333. fIdentityName = row.identityName
  334. fNickname = row.nickname
  335. fFirstname = row.firstname
  336. fLastname = row.lastname
  337. fAvatar = row.avatar
  338. hasAvatarPreview = row.hasAvatar
  339. return null
  340. }
  341. rowOf = (id) => {
  342. for (row of identities) { if ('' + row.id == '' + id) { return row } }
  343. return null
  344. }
  345. on openNew(e) {
  346. message = ''
  347. notice = ''
  348. editId = ''
  349. fIdentityName = ''
  350. fNickname = ''
  351. fFirstname = ''
  352. fLastname = ''
  353. fAvatar = ''
  354. hasAvatarPreview = false
  355. editHeading = 'New identity'
  356. welcome = false
  357. notWelcome = true
  358. editing = true
  359. }
  360. on openEdit(id) {
  361. message = ''
  362. notice = ''
  363. row = rowOf(id)
  364. if (row == null) { return null }
  365. fillForm(row)
  366. editHeading = 'Edit ' + row.label
  367. welcome = false
  368. notWelcome = true
  369. editing = true
  370. }
  371. on closeForm(e) {
  372. // stopgap until hybriel#193: after the first-login welcome (not for an app's choice) reload so the header gets its user menu
  373. if (welcome && !forApp) { window.location.assign(homeUrl) }
  374. editing = false
  375. welcome = false
  376. notWelcome = true
  377. message = ''
  378. choosing = forApp
  379. }
  380. on saveForm(e) {
  381. message = ''
  382. fields = { identityName = fIdentityName nickname = fNickname firstname = fFirstname lastname = fLastname avatar = fAvatar }
  383. let r = null
  384. if (editId == '') {
  385. r = emit server addIdentity(fields)
  386. } else {
  387. r = emit server editIdentity('' + editId, fields)
  388. }
  389. if (r == null) {
  390. message = 'the server did not answer — try again'
  391. return null
  392. }
  393. if (r.error != null) {
  394. message = r.error
  395. return null
  396. }
  397. identities = r.identities
  398. notice = editId == '' ? 'Identity created.' : 'Identity saved.'
  399. // stopgap until hybriel#193: the first-login welcome ends with a reload (the header gets its user menu)
  400. if (welcome && !forApp) { window.location.assign(homeUrl) }
  401. editing = false
  402. welcome = false
  403. notWelcome = true
  404. choosing = forApp
  405. }
  406. on remove(id) {
  407. message = ''
  408. notice = ''
  409. row = rowOf(id)
  410. if (row == null) { return null }
  411. if (!confirm('Delete the identity “' + row.label + '”?')) { return null }
  412. r = emit server dropIdentity('' + id)
  413. if (r == null) {
  414. message = 'the server did not answer — try again'
  415. return null
  416. }
  417. if (r.error != null) {
  418. message = r.error
  419. return null
  420. }
  421. identities = r.identities
  422. if ('' + editId == '' + id) { editing = false }
  423. notice = 'Identity deleted.'
  424. }
  425. on useBrowserZone(e) { tzInput = browserZone() }
  426. on saveZone(e) {
  427. message = ''
  428. notice = ''
  429. v = tzInput.trim()
  430. if (!knownZone(v)) {
  431. message = 'this browser does not know the time zone “' + v + '”'
  432. return null
  433. }
  434. r = emit server changeTimeZone(v)
  435. if (r == null) {
  436. message = 'the server did not answer — try again'
  437. return null
  438. }
  439. if (r.error != null) {
  440. message = r.error
  441. return null
  442. }
  443. timeZone = r.timeZone
  444. tzInput = r.timeZone
  445. notice = 'Time zone saved.'
  446. }
  447. // "Other address": the session forgets the pending sign-in, back to the email form
  448. on back(e) {
  449. message = ''
  450. r = emit server forgetPending()
  451. window.location.assign(homeUrl)
  452. }
  453. on doSignOut(e) {
  454. emit server signOut()
  455. signedIn = false
  456. choosing = false
  457. manage = false
  458. editing = false
  459. welcome = false
  460. notWelcome = true
  461. meEmail = ''
  462. identities = []
  463. askEmail = true
  464. message = ''
  465. notice = ''
  466. // stopgap until hybriel#193: reload so the header drops its user menu
  467. window.location.assign(homeUrl)
  468. }
  469. // SIGNS OUT ON EVERY DEVICE at once (bumps the account's session epoch, lib/accounts.hl
  470. // signOutEverywhere) — this browser included, so it resets to the sign-in form too.
  471. on doSignOutAll(e) {
  472. message = ''
  473. notice = ''
  474. if (!confirm('Sign out of ident on every device?')) { return null }
  475. r = emit server signOutAll()
  476. if (r == null) {
  477. message = 'the server did not answer — try again'
  478. return null
  479. }
  480. if (r.error != null) {
  481. message = r.error
  482. return null
  483. }
  484. signedIn = false
  485. choosing = false
  486. manage = false
  487. editing = false
  488. welcome = false
  489. notWelcome = true
  490. meEmail = ''
  491. identities = []
  492. askEmail = true
  493. notice = 'Signed out on every device.'
  494. // stopgap until hybriel#193: reload so the header drops its user menu
  495. window.location.assign(homeUrl)
  496. }
  497. // ---- the faces ------------------------------------------------------------------------
  498. // A face's LAST parameter is the session (the framework appends it). Every face that
  499. // needs the account asks accountOfSession, which only accepts the framework's Session.
  500. // A face runs on a BLANK instance: it has its arguments and its imports, not this
  501. // component's members or functions.
  502. // (the code request is NOT a face since mission 010: POST /api/code in lib/api.hl — a face
  503. // sees no request headers, so it could not apply the per-IP limit; a face here would be a
  504. // way around it)
  505. // the right code signs the session in; the first one for an address creates the
  506. // account, its default identity and stores the browser's time zone
  507. on server verifyCode(email, code, timeZone, session) {
  508. if (session == null) { return { error = 'no session — reload the page' } }
  509. if (email == null || hlTypeName(email) != 'String' || code == null || hlTypeName(code) != 'String') { return { error = 'email and code must be strings' } }
  510. return signInWithCode(session, email, code, timeZone)
  511. }
  512. on server addIdentity(fields, session) {
  513. let me = accountOfSession(session)
  514. if (me == null) { return { error = 'you are not signed in' } }
  515. r = createIdentity(me.id, fields)
  516. if (r.error != null) { return r }
  517. return { identity = r.identity identities = identityRows(me.id) }
  518. }
  519. on server editIdentity(id, fields, session) {
  520. let me = accountOfSession(session)
  521. if (me == null) { return { error = 'you are not signed in' } }
  522. r = updateIdentity(me.id, id, fields)
  523. if (r.error != null) { return r }
  524. return { identity = r.identity identities = identityRows(me.id) }
  525. }
  526. on server dropIdentity(id, session) {
  527. let me = accountOfSession(session)
  528. if (me == null) { return { error = 'you are not signed in' } }
  529. r = deleteIdentity(me.id, id)
  530. if (r.error != null) { return r }
  531. return { deleted = r.deleted identities = identityRows(me.id) }
  532. }
  533. on server changeTimeZone(tz, session) {
  534. let me = accountOfSession(session)
  535. if (me == null) { return { error = 'you are not signed in' } }
  536. r = setTimeZone(me.id, tz)
  537. if (r.error != null) { return r }
  538. return { timeZone = r.account.timeZone }
  539. }
  540. // the identity for the app's login request (lib/apps.hl grantRequest: a plain login, or an invite's): { url } or { error }
  541. on server chooseIdentity(rid, identity, session) {
  542. let me = accountOfSession(session)
  543. if (me == null) { return { error = 'you are not signed in' } }
  544. if (rid == null || hlTypeName(rid) != 'String') { return { error = 'field rid must be a string' } }
  545. if (identity == null || hlTypeName(identity) != 'String') { return { error = 'field identity must be a string' } }
  546. return grantRequest(me.id, rid, identity)
  547. }
  548. // THE PENDING SIGN-IN (ident#20): recorded after POST /api/code answered, only while a
  549. // code for that address is really waiting (lib/login.hl recordPending); "Other address"
  550. // forgets it. Named apart from the store functions (faces dispatch by name, hybriel#36).
  551. on server rememberPending(email, session) {
  552. return recordPending(session, email)
  553. }
  554. on server forgetPending(session) {
  555. return dropPending(session)
  556. }
  557. on server signOut(session) {
  558. if (session != null) { session.user = null }
  559. return true
  560. }
  561. on server signOutAll(session) {
  562. let me = accountOfSession(session)
  563. if (me == null) { return { error = 'you are not signed in' } }
  564. // pushed BEFORE the sessions go: the audience reads each connection's session user
  565. emit client signedOutAll(me.id)
  566. return signOutEverywhere(me.id)
  567. }

Branches

Latest commits

  • b37875ccident mission 012 part 3: real-Chrome fixes (brand 44 px, identity form width), e2e walk, report, logmre
  • f989c2ebident mission 012: stopgap reload after in-place sign-in/sign-out (until hybriel#193), gates wait for cold start, welcome end reloadsmre
  • 443291d4ident mission 012: /start on its own shell (no account), browser gate 152/0, reportmre
  • 021dd0fcident mission 012: browser gate waits cold start (IDENT_COLD_MS), header selectors, e2e checks; shell events from a page do not reach it (probe), current not marked, account-bar link 44 pxmre
  • 97f77b07ident mission 012 (WIP): onto the layouts theme dbe3de7, shell on AppHeader/MainMenu/UserMenu/Sidebar + ContentFirst, styles cut, check-theme gatemre
  • 8e4f435bpaths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • fa288f63ident mission 011: report wording (Intl zone names)mre
  • 961fae01ident mission 011: report, LOG, STATUSmre
  • 65348039ident#7: delivery gate — console check split at the gate's own server restart (49 checks)mre
  • dfa7b783ident#7: README (Delivery, env, gate, files, data), deploy.sh runs tests/delivery.mjsmre
  • ab6331f4ident#7: tests/delivery.mjs — fake clock gate: Vienna/New York/Tokyo/UTC 17:00, urgent, mail off, restart, DST days, zone changemre
  • 7869f57bident#7: delivery — the daily mail at 17:00 in the user's zone (digests table, once per local day, test clock IDENT_TEST_CLOCK), urgent mailed at once, push hookmre
  • 371ef1b5ident#7: lib/mail.hl sendNotificationMail (sink: <sink>.mail, one JSON line per mail)mre
  • 39749e0bident#7: time zones through hl:time — server checks isZone, an account without a known zone reads as UTC, allAccountsmre
  • 7a54fe72mission brief 011mre
  • a6a874cdident mission 010: vendor hybriel 0f396652 (plugins + compose cache volume/tmpfs + deploy URL wait + report)mre
  • 4e7cf78emission brief 010mre
  • e8b2b0f7docker-compose: init: true (hybriel#156, PID 1 ignored SIGTERM, every restart waited 10 s)mre
  • 5fdbb6b2ident mission 009: report — scratch folder notemre
  • 74235815ident mission 009 (4/4): docs (README files map + same-output test, STATUS, LOG), report, tests/letcount.py + realdata-baseline/comparemre