commit
This commit is contained in:
48
src/types/next-auth.d.ts
vendored
Normal file
48
src/types/next-auth.d.ts
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { DefaultSession } from 'next-auth';
|
||||
import type { Permission } from '@/lib/auth/permissions';
|
||||
|
||||
declare module 'next-auth' {
|
||||
interface Session {
|
||||
user: DefaultSession['user'] & {
|
||||
id: string;
|
||||
systemRole: string;
|
||||
activeOrganizationId: string | null;
|
||||
activeOrganizationName: string | null;
|
||||
activeOrganizationPlan: string | null;
|
||||
membershipRole: string | null;
|
||||
role: string | null;
|
||||
employeeCode: string | null;
|
||||
employeeId: number | null;
|
||||
provider: string | null;
|
||||
businessRole: 'IT' | 'HRD' | 'EMPLOYEE' | null;
|
||||
permissions: Permission[];
|
||||
effectivePermissions: Permission[];
|
||||
permissionTemplateIds: number[];
|
||||
organizations: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
membershipRole: string;
|
||||
role: string;
|
||||
plan: string;
|
||||
imageUrl: string | null;
|
||||
permissionTemplateIds: number[];
|
||||
}>;
|
||||
};
|
||||
}
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
systemRole?: string;
|
||||
activeOrganizationId?: string | null;
|
||||
employeeCode?: string | null;
|
||||
employeeId?: number | null;
|
||||
provider?: string | null;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'next-auth/jwt' {
|
||||
interface JWT {
|
||||
sub?: string;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user