satupeta-main/shared/types/auth.d.ts
2026-02-23 12:21:05 +07:00

61 lines
1.2 KiB
TypeScript
Executable File

import "next-auth";
// Extend the built-in session types
declare module "next-auth" {
/**
* Penambahan property untuk User
*/
interface User {
id: string;
name?: string | null;
email?: string | null;
image?: string | null;
username: string;
role: Role;
organizationId: string;
access_token: string;
refresh_token: string;
accessTokenExpires: number;
}
/**
* Penambahan property untuk Session
*/
interface Session {
access_token: string;
refresh_token: string;
error?: string;
user: {
id: string;
name?: string | null;
email?: string | null;
image?: string | null;
username: string;
role: Role;
organizationId: string;
};
}
}
// Extend JWT untuk menyimpan data token
declare module "next-auth/jwt" {
/**
* Extends the built-in JWT type
*/
interface JWT {
access_token: string;
refresh_token: string;
accessTokenExpires: number;
error?: string;
user: {
id: string;
name?: string | null;
email?: string | null;
image?: string | null;
username: string;
role: Role;
organizationId: string;
};
}
}