Skip to content

Commit dbb366c

Browse files
authored
Add button "Post product" for admin. (#2)
* Add isAdmin property to User and Session, modify authOptions and env This commit adds isAdmin property to User and Session interfaces, sets isAdmin based on user email in authOptions, and introduces ADMIN and SUPER_ADMIN variables in env for user role validation. The isAdmin property is utilized for admin authentication check. * Introduce Button component and utility functions Added a Button component with variant handling and utility functions for class merging, currency formatting, relative date calculation, slug conversion, and admin role check. * Add new dependencies including Radix UI themes in package-lock.json Several new dependencies such as Radix UI themes and related packages have been included in the project to enhance UI functionality and styling options. This addition aims to improve the user interface and overall user experience of the application.
1 parent 9c66ba1 commit dbb366c

File tree

10 files changed

+1714
-82
lines changed

10 files changed

+1714
-82
lines changed

Diff for: @types/next-auth.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ declare module 'next-auth' {
44
interface Session {
55
user: {
66
id: string;
7+
isAdmin: boolean;
78
} & DefaultSession['user'];
89
}
910
}

0 commit comments

Comments
 (0)