feat: implement TASK-WP1-02 login sessions

This commit is contained in:
suyx
2026-07-28 16:28:30 +08:00
parent f467e7c09f
commit ee70001d44
20 changed files with 2480 additions and 28 deletions
+6
View File
@@ -19,6 +19,9 @@ export const stableEngineeringErrors = {
IDEMPOTENCY_KEY_CONFLICT: { httpStatus: 409, messageKey: "request.idempotency_conflict" },
AUTH_SESSION_INVALID: { httpStatus: 401, messageKey: "auth.session.invalid" },
AUTH_SERVICE_UNAVAILABLE: { httpStatus: 503, messageKey: "auth.service.unavailable" },
AUTH_ENTRY_REJECTED: { httpStatus: 409, messageKey: "auth.entry.rejected" },
AUTH_RATE_LIMITED: { httpStatus: 429, messageKey: "auth.rate_limited" },
AUTH_CSRF_INVALID: { httpStatus: 403, messageKey: "auth.csrf.invalid" },
} as const;
export type StableEngineeringErrorCode = keyof typeof stableEngineeringErrors;
@@ -55,6 +58,9 @@ export const StableEngineeringErrorCodeSchema = Type.Union(
Type.Literal("IDEMPOTENCY_KEY_CONFLICT"),
Type.Literal("AUTH_SESSION_INVALID"),
Type.Literal("AUTH_SERVICE_UNAVAILABLE"),
Type.Literal("AUTH_ENTRY_REJECTED"),
Type.Literal("AUTH_RATE_LIMITED"),
Type.Literal("AUTH_CSRF_INVALID"),
],
{ $id: "StableEngineeringErrorCode" },
);