41aca718c9
- Replace Prisma database calls with API fetches from the reader API in GenreDetailPage, GenresPage, SearchPage, ChapterReaderPage, and NovelDetailPage. - Introduce new utility functions for API requests in server-api.ts, including error handling. - Update authentication flow in auth.ts to sync Google login with the reader API. - Modify NextAuth session and JWT types to include additional user information. - Clean up unused imports and code related to Prisma and MongoDB connections. - Adjust the configuration in next.config.mjs to remove unnecessary API routes.
29 lines
563 B
TypeScript
29 lines
563 B
TypeScript
import NextAuth from "next-auth"
|
|
import { JWT } from "next-auth/jwt"
|
|
|
|
declare module "next-auth" {
|
|
interface Session {
|
|
user: {
|
|
id: string
|
|
name?: string | null
|
|
email?: string | null
|
|
image?: string | null
|
|
role: string
|
|
}
|
|
accessToken?: string | null
|
|
}
|
|
|
|
interface User {
|
|
role: string
|
|
}
|
|
}
|
|
|
|
declare module "next-auth/jwt" {
|
|
interface JWT {
|
|
id?: string
|
|
role?: string
|
|
accessToken?: string | null
|
|
picture?: string | null
|
|
}
|
|
}
|