The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import * as RpcMiddleware from "effect/rpc/RpcMiddleware"; |
| 2 | import * as Schema from "effect/Schema"; |
| 3 | import { CurrentUser } from "./CurrentUser.context.ts"; |
| 4 | |
| 5 | /** The request has no session. */ |
| 6 | export class Unauthorized extends Schema.TaggedError<Unauthorized>()("Unauthorized", {}) {} |
| 7 | |
| 8 | /** Provides the signed-in user, from the session cookie better-auth set. */ |
| 9 | export class Session extends RpcMiddleware.Service<Session, { provides: CurrentUser }>()( |
| 10 | "Notes/Session", |
| 11 | { error: Unauthorized }, |
| 12 | ) {} |