╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │40 var page_arena = std.heap.ArenaAllocator.init(allocator); │ │41 defer page_arena.deinit(); │ │42 │ │43 - // create the admin repo and build the Page from it │ │44 - const page: ui.Page = blk: { │ │45 - const work_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "server", "admin" });│ │46 - defer allocator.free(work_path); │ │43 + const work_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "server", "admin" }); │ │44 + defer allocator.free(work_path); │ │45 │ │48 - const repo_opts: rp.RepoOpts(.xit) = .{ .is_test = true }; │ │49 - const Repo = rp.Repo(.xit, repo_opts); │ │50 - var repo = try Repo.init(io, allocator, .{ .path = work_path }); │ │51 - defer repo.deinit(io, allocator); │ │46 + const repo_opts: rp.RepoOpts(.xit) = .{ .is_test = true }; │ │47 + const Repo = rp.Repo(.xit, repo_opts); │ │48 + var repo = try Repo.init(io, allocator, .{ .path = work_path }); │ │49 + defer repo.deinit(io, allocator); │ │50 + │ │51 + var session: ui.Session = .{}; │ │52 │ │53 + const page: ui.Page = blk: { │ │54 var arena = std.heap.ArenaAllocator.init(allocator); │ │55 defer arena.deinit(); │ │56 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │139 for (&repo_event_ids) |*id| id.* = evt.EventWithId.randomId(prng.random()); │ │140 │ │141 var password_hash_buf: [evt.User.password_hash_max_len]u8 = undefined; │ │141 - const password_hash = try evt.User.hashPassword("correct horse battery staple", &password_hash_buf, io);│ │142 + const password_hash = try evt.User.hashPassword("password", &password_hash_buf, io); │ │143 │ │144 var events_to_consume: [user_data.len + repo_data.len]evt.EventWithId = undefined; │ │145 for (user_data, 0..) |u, i| { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │187 // consume events into the database │ │188 try evt.consume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" });│ │189 │ │189 - break :blk .{ .home = try .init(repo_opts, &page_arena, &repo) }; │ │190 + break :blk .{ .home = try .init(repo_opts, &page_arena, &repo, &session) }; │ │191 }; │ │192 │ │193 // start the server │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────╮ │252 io: std.Io, │ │253 allocator: std.mem.Allocator, │ │254 page: *const ui.Page, │ │255 + session: *ui.Session, │ │256 │ │257 pub fn run(self: @This()) !void {│ │258 // launch the TUI │ ╰──────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │257 - try hx.ui.run(self.io, self.allocator, self.page); │ │259 + try hx.ui.run(self.io, self.allocator, self.page, self.session);│ │260 } │ │261 }; │ │262 │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │263 try srv.run(.xit, .{}, io, allocator, cwd_path, .{ │ │264 .data_dir = server_path, │ │263 - }, run_opts.err, Runnable{ .io = io, .allocator = allocator, .page = &page }); │ │265 + }, run_opts.err, Runnable{ .io = io, .allocator = allocator, .page = &page, .session = &session });│ │266 } │ │267 } │ │268 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯