Files
g-butandClaude Sonnet 4.6 7db1780ae0 refactor(config): add USER_ROLE constants, eliminate all role magic strings
Add USER_ROLE named-constants object and UserRole type to lib/config/auth.ts —
the SSOT for user role values. Replace every raw "patient" / "admin" string
comparison in auth, middleware, cron routes, API routes, admin pages, and the
UserDropdown component with typed USER_ROLE constants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:22:19 +02:00

13 lines
276 B
TypeScript

import type { DefaultSession } from "next-auth";
import type { UserRole } from "@/lib/config/auth";
declare module "next-auth" {
interface Session {
user: {
id: string;
role: UserRole;
emailVerified: Date | null;
} & DefaultSession["user"];
}
}