gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3691e1763691e176tracker#1: empty tracker with the ident login (state of 2026-09-27)mre3691e176/components/home.hl

1.6 KB

  1. // components/home.hl — `/`: STEP 1, the empty homepage (tracker.worldapi.org#1).
  2. // Signed out: a link to ident's login button flow (`/login`, project.hl). Signed in: the
  3. // identity's public short id (ident hands nothing else to an app yet — properties handover
  4. // is ident#11, on hold) and a sign-out button. Nothing else: no shows, no data (CONCEPT.md,
  5. // tracker.worldapi.org#1 "Nothing else").
  6. parent './main.hl'
  7. session = null
  8. me = session != null ? session.user : null
  9. signedIn = me != null
  10. signedOut = !signedIn
  11. identity = signedIn ? me.identity : ''
  12. __title = 'tracker' + (signedIn ? ' | ' + identity : ' | sign in')
  13. View {
  14. homeCard {
  15. if (signedOut) {
  16. h1 { "tracker" }
  17. p { "Sign in to see your homepage." }
  18. a { id = "signin" class = "button" href = "/login" "Sign in with ident" }
  19. }
  20. if (signedIn) {
  21. accountBar {
  22. userName { id = "identity" "Signed in as " identity }
  23. button { id = "signout" type = "button" class = "quiet" "Sign out" on click(e) { emit doSignOut(e) } }
  24. }
  25. h1 { "tracker" }
  26. p { id = "empty" "Nothing here yet." }
  27. }
  28. }
  29. }
  30. // the click emits a CLIENT handler, which calls the server face and then flips this
  31. // page's own reactive members — a member's INITIAL value is a computed expression, but
  32. // once mounted it is plain reactive state a handler can overwrite (ident's own doSignOut
  33. // does the same: components/home.hl, `emit server signOut()` then `signedIn = false` …).
  34. on doSignOut(e) {
  35. emit server signOut()
  36. signedIn = false
  37. signedOut = true
  38. identity = ''
  39. }
  40. on server signOut(session) {
  41. if (session != null) { session.user = null }
  42. return {}
  43. }

Branches

Latest commits

  • 3691e176tracker#1: empty tracker with the ident login (state of 2026-09-27)mre