feat: Implement user authentication using NextAuth with social and credentials providers.
This commit is contained in:
27
src/types/next-auth.d.ts
vendored
Normal file
27
src/types/next-auth.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { DefaultSession, DefaultUser } from "next-auth";
|
||||
|
||||
declare module "next-auth" {
|
||||
interface Session {
|
||||
user: {
|
||||
id: string;
|
||||
role: "USER" | "AGENT" | "ADMIN";
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
} & DefaultSession["user"];
|
||||
}
|
||||
|
||||
interface User extends DefaultUser {
|
||||
role: "USER" | "AGENT" | "ADMIN";
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "next-auth/jwt" {
|
||||
interface JWT {
|
||||
id: string;
|
||||
role: "USER" | "AGENT" | "ADMIN";
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user