diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-05-20 10:16:50 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-05-20 10:16:50 +0200 |
| commit | 44445734ba4a0f05564f808c2fd34a7f23c6fafb (patch) | |
| tree | 3bd22add718620cbf931286f55137bcc666100be /src/routes/api/session/current.zig | |
| parent | 95ae9f15e1db335a7f8358d811ea37e2c89dd10f (diff) | |
Let's do a rewrite!
Created project structure and changed `build.zig` and added licence.
Diffstat (limited to 'src/routes/api/session/current.zig')
| -rw-r--r-- | src/routes/api/session/current.zig | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/routes/api/session/current.zig b/src/routes/api/session/current.zig deleted file mode 100644 index 897d01c..0000000 --- a/src/routes/api/session/current.zig +++ /dev/null @@ -1,27 +0,0 @@ -const std = @import("std"); - -const memora = @import("memora"); -const Context = memora.Context; - -pub const access = .users; - -const Result = struct { - name: []const u8, - full_name: []const u8, - birthday: []const u8, - is_admin: bool, -}; - -pub fn get(ctx: *Context) !Result { - const session = ctx.storage.sessions.get( - ctx.storage, - ctx.fingerprint, - ) orelse return error.UserDoesNotExist; - - return .{ - .name = session.info.name, - .full_name = session.info.full_name, - .birthday = session.info.birthday, - .is_admin = session.info.is_admin, - }; -} |