feat: Implement user authentication using NextAuth with social and credentials providers.

This commit is contained in:
pradeepkumar
2025-12-20 19:22:35 +05:30
parent b1cd8376ac
commit 218337666e
8 changed files with 452 additions and 3 deletions

27
src/types/next-auth.d.ts vendored Normal file
View 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;
}
}