mirror of
https://github.com/bitbaum/vitareba.git
synced 2026-12-04 16:47:33 +01:00
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>
13 lines
276 B
TypeScript
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"];
|
|
}
|
|
}
|