aboutsummaryrefslogtreecommitdiff
path: root/src/storage/root.zig
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-11-15 11:54:00 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2025-11-15 11:56:24 +0100
commite8ff326f0e5bd61fb0a8c22c48f296fcf0249830 (patch)
tree19d8c026f8460ec577f446a7d61e68c38acddde0 /src/storage/root.zig
parent007bc3fe0615f38cb31d5116759ed3500f6fd3e6 (diff)
backend implement auth-service
Diffstat (limited to 'src/storage/root.zig')
-rw-r--r--src/storage/root.zig9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/storage/root.zig b/src/storage/root.zig
index bf9803e..f1a753c 100644
--- a/src/storage/root.zig
+++ b/src/storage/root.zig
@@ -3,10 +3,14 @@ const config = @import("../config.zig");
const prompt = @import("../prompt.zig");
pub const User = @import("user.zig");
+pub const SessionManager = @import("session-manager/root.zig");
+pub const Session = SessionManager.Session;
const Self = @This();
dir: std.fs.Dir,
+sessions: SessionManager = .empty,
+allocator: std.mem.Allocator,
pub fn init(allocator: std.mem.Allocator) !Self {
const dir = std.fs.cwd().openDir(config.storage_path, .{}) catch blk: {
@@ -14,7 +18,10 @@ pub fn init(allocator: std.mem.Allocator) !Self {
break :blk try std.fs.cwd().openDir(config.storage_path, .{});
};
- var self = Self { .dir = dir };
+ var self = Self {
+ .dir = dir,
+ .allocator = allocator,
+ };
dir.access("user", .{}) catch |err| switch (err) {
error.FileNotFound => {