mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-11 22:54:45 -05:00
chore(deps): Update project dependencies and refactor authentication flow
- Upgrade Next.js to version 15.1.7 - Update Drizzle ORM and related dependencies - Add Nodemailer and related type definitions - Refactor authentication routes and components - Modify user schema to include first and last name - Update authentication configuration and session handling - Remove deprecated login and register pages - Restructure authentication-related components and routes
This commit is contained in:
@@ -26,13 +26,20 @@ declare module "@auth/core/types" {
|
||||
user: {
|
||||
id: string;
|
||||
email: string;
|
||||
firstName: string | null;
|
||||
lastName: string | null;
|
||||
} & DefaultSession["user"];
|
||||
}
|
||||
|
||||
// interface User {
|
||||
// // ...other properties
|
||||
// // role: UserRole;
|
||||
// }
|
||||
interface User {
|
||||
id?: string;
|
||||
email?: string | null;
|
||||
firstName?: string | null;
|
||||
lastName?: string | null;
|
||||
password?: string | null;
|
||||
emailVerified?: Date | null;
|
||||
image?: string | null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,7 +49,7 @@ declare module "@auth/core/types" {
|
||||
*/
|
||||
export const authConfig = {
|
||||
adapter: DrizzleAdapter(db, {
|
||||
usersTable: users,
|
||||
usersTable: users as any,
|
||||
accountsTable: accounts,
|
||||
sessionsTable: sessions,
|
||||
verificationTokensTable: verificationTokens,
|
||||
@@ -89,7 +96,10 @@ export const authConfig = {
|
||||
return {
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.name ?? null,
|
||||
firstName: user.firstName,
|
||||
lastName: user.lastName,
|
||||
emailVerified: user.emailVerified,
|
||||
image: user.image,
|
||||
};
|
||||
}
|
||||
})
|
||||
@@ -100,10 +110,14 @@ export const authConfig = {
|
||||
user: {
|
||||
...session.user,
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.firstName && user.lastName ? `${user.firstName} ${user.lastName}` : null,
|
||||
firstName: user.firstName,
|
||||
lastName: user.lastName,
|
||||
},
|
||||
}),
|
||||
},
|
||||
pages: {
|
||||
signIn: '/login',
|
||||
signIn: '/auth/signin',
|
||||
},
|
||||
} satisfies AuthConfig;
|
||||
|
||||
Reference in New Issue
Block a user