implemented inital nextAuth logic
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
import NextAuth from 'next-auth';
|
||||
|
||||
export default NextAuth();
|
||||
13
apps/hub/app/(auth)/login/page.tsx
Normal file
13
apps/hub/app/(auth)/login/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Provider } from 'next-auth/providers/index';
|
||||
import { getProviders } from 'next-auth/react';
|
||||
|
||||
export default async () => {
|
||||
const providers = await getProviders();
|
||||
console.log(providers);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-5xl">Login</h1>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
12
apps/hub/app/_components/AuthSessionProvider.tsx
Normal file
12
apps/hub/app/_components/AuthSessionProvider.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
'use client';
|
||||
|
||||
import { SessionProvider } from 'next-auth/react';
|
||||
import { Session } from 'next-auth';
|
||||
|
||||
export const NextAuthSessionProvider = ({
|
||||
children,
|
||||
session,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
session: Session | null;
|
||||
}) => <SessionProvider session={session}>{children}</SessionProvider>;
|
||||
53
apps/hub/app/api/auth/[...nextauth]/auth.ts
Normal file
53
apps/hub/app/api/auth/[...nextauth]/auth.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import NextAuth, { AuthOptions } from 'next-auth';
|
||||
import { PrismaAdapter } from '@next-auth/prisma-adapter';
|
||||
import Credentials from 'next-auth/providers/credentials';
|
||||
import { prisma } from '@repo/db';
|
||||
import bcrypt from 'bcryptjs';
|
||||
|
||||
export const options = {
|
||||
providers: [
|
||||
Credentials({
|
||||
credentials: {
|
||||
email: { label: 'Email', type: 'email', placeholder: 'E-Mail' },
|
||||
password: { label: 'Password', type: 'password' },
|
||||
},
|
||||
async authorize(credentials, req) {
|
||||
try {
|
||||
if (!credentials) throw new Error('No credentials provided');
|
||||
const user = await prisma.user.findFirstOrThrow({
|
||||
where: { email: credentials.email },
|
||||
});
|
||||
if (bcrypt.compareSync(credentials.password, user.password)) {
|
||||
return user;
|
||||
}
|
||||
return null;
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
}),
|
||||
],
|
||||
secret: process.env.SECRET,
|
||||
session: {
|
||||
strategy: 'jwt',
|
||||
maxAge: 30 * 24 * 60 * 60,
|
||||
},
|
||||
adapter: PrismaAdapter(prisma),
|
||||
events: {
|
||||
async signIn(message) {
|
||||
console.log('Signed in!', { message });
|
||||
},
|
||||
async signOut(message) {
|
||||
console.log('Signed out!', { message });
|
||||
},
|
||||
async createUser(message) {
|
||||
console.log('User created!', { message });
|
||||
},
|
||||
},
|
||||
pages: {
|
||||
signIn: '/login',
|
||||
signOut: '/logout',
|
||||
error: '/authError',
|
||||
newUser: '/register',
|
||||
},
|
||||
} satisfies AuthOptions;
|
||||
6
apps/hub/app/api/auth/[...nextauth]/route.ts
Normal file
6
apps/hub/app/api/auth/[...nextauth]/route.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import NextAuth from 'next-auth';
|
||||
import { options } from './auth';
|
||||
|
||||
const handler = NextAuth(options);
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
@@ -1,34 +1,40 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import type { Metadata } from 'next';
|
||||
import { Geist, Geist_Mono } from 'next/font/google';
|
||||
import './globals.css';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { NextAuthSessionProvider } from './_components/AuthSessionProvider';
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"],
|
||||
variable: '--font-geist-sans',
|
||||
subsets: ['latin'],
|
||||
});
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
variable: '--font-geist-mono',
|
||||
subsets: ['latin'],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
title: 'Create Next App',
|
||||
description: 'Generated by create next app',
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const session = await getServerSession();
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<NextAuthSessionProvider session={session}>
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
{children}
|
||||
</body>
|
||||
</NextAuthSessionProvider>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
'use client';
|
||||
|
||||
import { useSession } from 'next-auth/react';
|
||||
|
||||
export default function Home() {
|
||||
const { data: session, status } = useSession();
|
||||
console.log(session, status);
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-5xl">Hub</h1>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { AuthOptions } from 'next-auth';
|
||||
import { PrismaAdapter } from '@next-auth/prisma-adapter';
|
||||
import Email from 'next-auth/providers/email';
|
||||
import { prisma } from '@repo/db';
|
||||
|
||||
export const options = {
|
||||
providers: [
|
||||
Email({
|
||||
server: process.env.EMAIL_SERVER,
|
||||
from: process.env.EMAIL_FROM,
|
||||
}),
|
||||
],
|
||||
secret: process.env.SECRET,
|
||||
adapter: PrismaAdapter(prisma),
|
||||
} satisfies AuthOptions;
|
||||
@@ -11,6 +11,7 @@
|
||||
"dependencies": {
|
||||
"@next-auth/prisma-adapter": "^1.0.7",
|
||||
"@repo/ui": "*",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"next": "15.1.4",
|
||||
"next-auth": "^4.24.11",
|
||||
"react": "^19.0.0",
|
||||
@@ -18,6 +19,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3",
|
||||
"@types/bcryptjs": "^2.4.6",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
|
||||
13
package-lock.json
generated
13
package-lock.json
generated
@@ -40,6 +40,7 @@
|
||||
"dependencies": {
|
||||
"@next-auth/prisma-adapter": "^1.0.7",
|
||||
"@repo/ui": "*",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"next": "15.1.4",
|
||||
"next-auth": "^4.24.11",
|
||||
"react": "^19.0.0",
|
||||
@@ -47,6 +48,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3",
|
||||
"@types/bcryptjs": "^2.4.6",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
@@ -1219,6 +1221,12 @@
|
||||
"workspaces": "dist/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/bcryptjs": {
|
||||
"version": "2.4.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.6.tgz",
|
||||
"integrity": "sha512-9xlo6R2qDs5uixm0bcIqCeMCE6HiQsIyel9KQySStiyqNl2tnj2mP3DX1Nf56MD6KMenNNlBBsy3LJ7gUEQPXQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
|
||||
@@ -1921,6 +1929,11 @@
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bcryptjs": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
|
||||
"integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ=="
|
||||
},
|
||||
"node_modules/binary-extensions": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -143,8 +143,10 @@ exports.Prisma.SessionScalarFieldEnum = {
|
||||
|
||||
exports.Prisma.UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
firstname: 'firstname',
|
||||
lastname: 'lastname',
|
||||
email: 'email',
|
||||
password: 'password',
|
||||
emailVerified: 'emailVerified',
|
||||
image: 'image',
|
||||
createdAt: 'createdAt',
|
||||
|
||||
217
packages/database/generated/client/index.d.ts
vendored
217
packages/database/generated/client/index.d.ts
vendored
@@ -3291,24 +3291,16 @@ export namespace Prisma {
|
||||
|
||||
export type AggregateUser = {
|
||||
_count: UserCountAggregateOutputType | null
|
||||
_avg: UserAvgAggregateOutputType | null
|
||||
_sum: UserSumAggregateOutputType | null
|
||||
_min: UserMinAggregateOutputType | null
|
||||
_max: UserMaxAggregateOutputType | null
|
||||
}
|
||||
|
||||
export type UserAvgAggregateOutputType = {
|
||||
id: number | null
|
||||
}
|
||||
|
||||
export type UserSumAggregateOutputType = {
|
||||
id: number | null
|
||||
}
|
||||
|
||||
export type UserMinAggregateOutputType = {
|
||||
id: number | null
|
||||
name: string | null
|
||||
id: string | null
|
||||
firstname: string | null
|
||||
lastname: string | null
|
||||
email: string | null
|
||||
password: string | null
|
||||
emailVerified: Date | null
|
||||
image: string | null
|
||||
createdAt: Date | null
|
||||
@@ -3316,9 +3308,11 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserMaxAggregateOutputType = {
|
||||
id: number | null
|
||||
name: string | null
|
||||
id: string | null
|
||||
firstname: string | null
|
||||
lastname: string | null
|
||||
email: string | null
|
||||
password: string | null
|
||||
emailVerified: Date | null
|
||||
image: string | null
|
||||
createdAt: Date | null
|
||||
@@ -3327,8 +3321,10 @@ export namespace Prisma {
|
||||
|
||||
export type UserCountAggregateOutputType = {
|
||||
id: number
|
||||
name: number
|
||||
firstname: number
|
||||
lastname: number
|
||||
email: number
|
||||
password: number
|
||||
emailVerified: number
|
||||
image: number
|
||||
createdAt: number
|
||||
@@ -3337,18 +3333,12 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
|
||||
export type UserAvgAggregateInputType = {
|
||||
id?: true
|
||||
}
|
||||
|
||||
export type UserSumAggregateInputType = {
|
||||
id?: true
|
||||
}
|
||||
|
||||
export type UserMinAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
firstname?: true
|
||||
lastname?: true
|
||||
email?: true
|
||||
password?: true
|
||||
emailVerified?: true
|
||||
image?: true
|
||||
createdAt?: true
|
||||
@@ -3357,8 +3347,10 @@ export namespace Prisma {
|
||||
|
||||
export type UserMaxAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
firstname?: true
|
||||
lastname?: true
|
||||
email?: true
|
||||
password?: true
|
||||
emailVerified?: true
|
||||
image?: true
|
||||
createdAt?: true
|
||||
@@ -3367,8 +3359,10 @@ export namespace Prisma {
|
||||
|
||||
export type UserCountAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
firstname?: true
|
||||
lastname?: true
|
||||
email?: true
|
||||
password?: true
|
||||
emailVerified?: true
|
||||
image?: true
|
||||
createdAt?: true
|
||||
@@ -3411,18 +3405,6 @@ export namespace Prisma {
|
||||
* Count returned Users
|
||||
**/
|
||||
_count?: true | UserCountAggregateInputType
|
||||
/**
|
||||
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
|
||||
*
|
||||
* Select which fields to average
|
||||
**/
|
||||
_avg?: UserAvgAggregateInputType
|
||||
/**
|
||||
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
|
||||
*
|
||||
* Select which fields to sum
|
||||
**/
|
||||
_sum?: UserSumAggregateInputType
|
||||
/**
|
||||
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
|
||||
*
|
||||
@@ -3456,23 +3438,21 @@ export namespace Prisma {
|
||||
take?: number
|
||||
skip?: number
|
||||
_count?: UserCountAggregateInputType | true
|
||||
_avg?: UserAvgAggregateInputType
|
||||
_sum?: UserSumAggregateInputType
|
||||
_min?: UserMinAggregateInputType
|
||||
_max?: UserMaxAggregateInputType
|
||||
}
|
||||
|
||||
export type UserGroupByOutputType = {
|
||||
id: number
|
||||
name: string | null
|
||||
email: string | null
|
||||
id: string
|
||||
firstname: string
|
||||
lastname: string
|
||||
email: string
|
||||
password: string
|
||||
emailVerified: Date | null
|
||||
image: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
_count: UserCountAggregateOutputType | null
|
||||
_avg: UserAvgAggregateOutputType | null
|
||||
_sum: UserSumAggregateOutputType | null
|
||||
_min: UserMinAggregateOutputType | null
|
||||
_max: UserMaxAggregateOutputType | null
|
||||
}
|
||||
@@ -3493,8 +3473,10 @@ export namespace Prisma {
|
||||
|
||||
export type UserSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
name?: boolean
|
||||
firstname?: boolean
|
||||
lastname?: boolean
|
||||
email?: boolean
|
||||
password?: boolean
|
||||
emailVerified?: boolean
|
||||
image?: boolean
|
||||
createdAt?: boolean
|
||||
@@ -3503,8 +3485,10 @@ export namespace Prisma {
|
||||
|
||||
export type UserSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
name?: boolean
|
||||
firstname?: boolean
|
||||
lastname?: boolean
|
||||
email?: boolean
|
||||
password?: boolean
|
||||
emailVerified?: boolean
|
||||
image?: boolean
|
||||
createdAt?: boolean
|
||||
@@ -3513,8 +3497,10 @@ export namespace Prisma {
|
||||
|
||||
export type UserSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
name?: boolean
|
||||
firstname?: boolean
|
||||
lastname?: boolean
|
||||
email?: boolean
|
||||
password?: boolean
|
||||
emailVerified?: boolean
|
||||
image?: boolean
|
||||
createdAt?: boolean
|
||||
@@ -3523,23 +3509,27 @@ export namespace Prisma {
|
||||
|
||||
export type UserSelectScalar = {
|
||||
id?: boolean
|
||||
name?: boolean
|
||||
firstname?: boolean
|
||||
lastname?: boolean
|
||||
email?: boolean
|
||||
password?: boolean
|
||||
emailVerified?: boolean
|
||||
image?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
}
|
||||
|
||||
export type UserOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt", ExtArgs["result"]["user"]>
|
||||
export type UserOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "firstname" | "lastname" | "email" | "password" | "emailVerified" | "image" | "createdAt" | "updatedAt", ExtArgs["result"]["user"]>
|
||||
|
||||
export type $UserPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
|
||||
name: "User"
|
||||
objects: {}
|
||||
scalars: $Extensions.GetPayloadResult<{
|
||||
id: number
|
||||
name: string | null
|
||||
email: string | null
|
||||
id: string
|
||||
firstname: string
|
||||
lastname: string
|
||||
email: string
|
||||
password: string
|
||||
emailVerified: Date | null
|
||||
image: string | null
|
||||
createdAt: Date
|
||||
@@ -3967,9 +3957,11 @@ export namespace Prisma {
|
||||
* Fields of the User model
|
||||
*/
|
||||
interface UserFieldRefs {
|
||||
readonly id: FieldRef<"User", 'Int'>
|
||||
readonly name: FieldRef<"User", 'String'>
|
||||
readonly id: FieldRef<"User", 'String'>
|
||||
readonly firstname: FieldRef<"User", 'String'>
|
||||
readonly lastname: FieldRef<"User", 'String'>
|
||||
readonly email: FieldRef<"User", 'String'>
|
||||
readonly password: FieldRef<"User", 'String'>
|
||||
readonly emailVerified: FieldRef<"User", 'DateTime'>
|
||||
readonly image: FieldRef<"User", 'String'>
|
||||
readonly createdAt: FieldRef<"User", 'DateTime'>
|
||||
@@ -4168,7 +4160,7 @@ export namespace Prisma {
|
||||
/**
|
||||
* The data needed to create a User.
|
||||
*/
|
||||
data?: XOR<UserCreateInput, UserUncheckedCreateInput>
|
||||
data: XOR<UserCreateInput, UserUncheckedCreateInput>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5404,8 +5396,10 @@ export namespace Prisma {
|
||||
|
||||
export const UserScalarFieldEnum: {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
firstname: 'firstname',
|
||||
lastname: 'lastname',
|
||||
email: 'email',
|
||||
password: 'password',
|
||||
emailVerified: 'emailVerified',
|
||||
image: 'image',
|
||||
createdAt: 'createdAt',
|
||||
@@ -5667,9 +5661,11 @@ export namespace Prisma {
|
||||
AND?: UserWhereInput | UserWhereInput[]
|
||||
OR?: UserWhereInput[]
|
||||
NOT?: UserWhereInput | UserWhereInput[]
|
||||
id?: IntFilter<"User"> | number
|
||||
name?: StringNullableFilter<"User"> | string | null
|
||||
email?: StringNullableFilter<"User"> | string | null
|
||||
id?: StringFilter<"User"> | string
|
||||
firstname?: StringFilter<"User"> | string
|
||||
lastname?: StringFilter<"User"> | string
|
||||
email?: StringFilter<"User"> | string
|
||||
password?: StringFilter<"User"> | string
|
||||
emailVerified?: DateTimeNullableFilter<"User"> | Date | string | null
|
||||
image?: StringNullableFilter<"User"> | string | null
|
||||
createdAt?: DateTimeFilter<"User"> | Date | string
|
||||
@@ -5678,8 +5674,10 @@ export namespace Prisma {
|
||||
|
||||
export type UserOrderByWithRelationInput = {
|
||||
id?: SortOrder
|
||||
name?: SortOrderInput | SortOrder
|
||||
email?: SortOrderInput | SortOrder
|
||||
firstname?: SortOrder
|
||||
lastname?: SortOrder
|
||||
email?: SortOrder
|
||||
password?: SortOrder
|
||||
emailVerified?: SortOrderInput | SortOrder
|
||||
image?: SortOrderInput | SortOrder
|
||||
createdAt?: SortOrder
|
||||
@@ -5687,12 +5685,14 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: number
|
||||
id?: string
|
||||
email?: string
|
||||
AND?: UserWhereInput | UserWhereInput[]
|
||||
OR?: UserWhereInput[]
|
||||
NOT?: UserWhereInput | UserWhereInput[]
|
||||
name?: StringNullableFilter<"User"> | string | null
|
||||
firstname?: StringFilter<"User"> | string
|
||||
lastname?: StringFilter<"User"> | string
|
||||
password?: StringFilter<"User"> | string
|
||||
emailVerified?: DateTimeNullableFilter<"User"> | Date | string | null
|
||||
image?: StringNullableFilter<"User"> | string | null
|
||||
createdAt?: DateTimeFilter<"User"> | Date | string
|
||||
@@ -5701,26 +5701,28 @@ export namespace Prisma {
|
||||
|
||||
export type UserOrderByWithAggregationInput = {
|
||||
id?: SortOrder
|
||||
name?: SortOrderInput | SortOrder
|
||||
email?: SortOrderInput | SortOrder
|
||||
firstname?: SortOrder
|
||||
lastname?: SortOrder
|
||||
email?: SortOrder
|
||||
password?: SortOrder
|
||||
emailVerified?: SortOrderInput | SortOrder
|
||||
image?: SortOrderInput | SortOrder
|
||||
createdAt?: SortOrder
|
||||
updatedAt?: SortOrder
|
||||
_count?: UserCountOrderByAggregateInput
|
||||
_avg?: UserAvgOrderByAggregateInput
|
||||
_max?: UserMaxOrderByAggregateInput
|
||||
_min?: UserMinOrderByAggregateInput
|
||||
_sum?: UserSumOrderByAggregateInput
|
||||
}
|
||||
|
||||
export type UserScalarWhereWithAggregatesInput = {
|
||||
AND?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[]
|
||||
OR?: UserScalarWhereWithAggregatesInput[]
|
||||
NOT?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[]
|
||||
id?: IntWithAggregatesFilter<"User"> | number
|
||||
name?: StringNullableWithAggregatesFilter<"User"> | string | null
|
||||
email?: StringNullableWithAggregatesFilter<"User"> | string | null
|
||||
id?: StringWithAggregatesFilter<"User"> | string
|
||||
firstname?: StringWithAggregatesFilter<"User"> | string
|
||||
lastname?: StringWithAggregatesFilter<"User"> | string
|
||||
email?: StringWithAggregatesFilter<"User"> | string
|
||||
password?: StringWithAggregatesFilter<"User"> | string
|
||||
emailVerified?: DateTimeNullableWithAggregatesFilter<"User"> | Date | string | null
|
||||
image?: StringNullableWithAggregatesFilter<"User"> | string | null
|
||||
createdAt?: DateTimeWithAggregatesFilter<"User"> | Date | string
|
||||
@@ -5949,8 +5951,11 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserCreateInput = {
|
||||
name?: string | null
|
||||
email?: string | null
|
||||
id?: string
|
||||
firstname: string
|
||||
lastname: string
|
||||
email: string
|
||||
password: string
|
||||
emailVerified?: Date | string | null
|
||||
image?: string | null
|
||||
createdAt?: Date | string
|
||||
@@ -5958,9 +5963,11 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserUncheckedCreateInput = {
|
||||
id?: number
|
||||
name?: string | null
|
||||
email?: string | null
|
||||
id?: string
|
||||
firstname: string
|
||||
lastname: string
|
||||
email: string
|
||||
password: string
|
||||
emailVerified?: Date | string | null
|
||||
image?: string | null
|
||||
createdAt?: Date | string
|
||||
@@ -5968,8 +5975,11 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserUpdateInput = {
|
||||
name?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
email?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
id?: StringFieldUpdateOperationsInput | string
|
||||
firstname?: StringFieldUpdateOperationsInput | string
|
||||
lastname?: StringFieldUpdateOperationsInput | string
|
||||
email?: StringFieldUpdateOperationsInput | string
|
||||
password?: StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
image?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -5977,9 +5987,11 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateInput = {
|
||||
id?: IntFieldUpdateOperationsInput | number
|
||||
name?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
email?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
id?: StringFieldUpdateOperationsInput | string
|
||||
firstname?: StringFieldUpdateOperationsInput | string
|
||||
lastname?: StringFieldUpdateOperationsInput | string
|
||||
email?: StringFieldUpdateOperationsInput | string
|
||||
password?: StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
image?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -5987,9 +5999,11 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserCreateManyInput = {
|
||||
id?: number
|
||||
name?: string | null
|
||||
email?: string | null
|
||||
id?: string
|
||||
firstname: string
|
||||
lastname: string
|
||||
email: string
|
||||
password: string
|
||||
emailVerified?: Date | string | null
|
||||
image?: string | null
|
||||
createdAt?: Date | string
|
||||
@@ -5997,8 +6011,11 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserUpdateManyMutationInput = {
|
||||
name?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
email?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
id?: StringFieldUpdateOperationsInput | string
|
||||
firstname?: StringFieldUpdateOperationsInput | string
|
||||
lastname?: StringFieldUpdateOperationsInput | string
|
||||
email?: StringFieldUpdateOperationsInput | string
|
||||
password?: StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
image?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -6006,9 +6023,11 @@ export namespace Prisma {
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateManyInput = {
|
||||
id?: IntFieldUpdateOperationsInput | number
|
||||
name?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
email?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
id?: StringFieldUpdateOperationsInput | string
|
||||
firstname?: StringFieldUpdateOperationsInput | string
|
||||
lastname?: StringFieldUpdateOperationsInput | string
|
||||
email?: StringFieldUpdateOperationsInput | string
|
||||
password?: StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
image?: NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -6317,22 +6336,22 @@ export namespace Prisma {
|
||||
|
||||
export type UserCountOrderByAggregateInput = {
|
||||
id?: SortOrder
|
||||
name?: SortOrder
|
||||
firstname?: SortOrder
|
||||
lastname?: SortOrder
|
||||
email?: SortOrder
|
||||
password?: SortOrder
|
||||
emailVerified?: SortOrder
|
||||
image?: SortOrder
|
||||
createdAt?: SortOrder
|
||||
updatedAt?: SortOrder
|
||||
}
|
||||
|
||||
export type UserAvgOrderByAggregateInput = {
|
||||
id?: SortOrder
|
||||
}
|
||||
|
||||
export type UserMaxOrderByAggregateInput = {
|
||||
id?: SortOrder
|
||||
name?: SortOrder
|
||||
firstname?: SortOrder
|
||||
lastname?: SortOrder
|
||||
email?: SortOrder
|
||||
password?: SortOrder
|
||||
emailVerified?: SortOrder
|
||||
image?: SortOrder
|
||||
createdAt?: SortOrder
|
||||
@@ -6341,18 +6360,16 @@ export namespace Prisma {
|
||||
|
||||
export type UserMinOrderByAggregateInput = {
|
||||
id?: SortOrder
|
||||
name?: SortOrder
|
||||
firstname?: SortOrder
|
||||
lastname?: SortOrder
|
||||
email?: SortOrder
|
||||
password?: SortOrder
|
||||
emailVerified?: SortOrder
|
||||
image?: SortOrder
|
||||
createdAt?: SortOrder
|
||||
updatedAt?: SortOrder
|
||||
}
|
||||
|
||||
export type UserSumOrderByAggregateInput = {
|
||||
id?: SortOrder
|
||||
}
|
||||
|
||||
export type VerificationRequestCountOrderByAggregateInput = {
|
||||
id?: SortOrder
|
||||
identifier?: SortOrder
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "prisma-client-9c17f8cb04532af79797432ff37d662dfecbed92d0f99ae2e0477ea71381eed4",
|
||||
"name": "prisma-client-c7fdd0dfe7b541db0276548838969aa318b26f0ac7912a69d0a6f15415695df6",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"browser": "index-browser.js",
|
||||
|
||||
@@ -46,9 +46,11 @@ model Session {
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
name String?
|
||||
email String? @unique
|
||||
id String @id @default(uuid())
|
||||
firstname String
|
||||
lastname String
|
||||
email String @unique
|
||||
password String
|
||||
emailVerified DateTime? @map(name: "email_verified")
|
||||
image String?
|
||||
createdAt DateTime @default(now()) @map(name: "created_at")
|
||||
|
||||
@@ -143,8 +143,10 @@ exports.Prisma.SessionScalarFieldEnum = {
|
||||
|
||||
exports.Prisma.UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
firstname: 'firstname',
|
||||
lastname: 'lastname',
|
||||
email: 'email',
|
||||
password: 'password',
|
||||
emailVerified: 'emailVerified',
|
||||
image: 'image',
|
||||
createdAt: 'createdAt',
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"db:deploy": "npx prisma migrate deploy"
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
".": "./index.ts"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
|
||||
@@ -46,9 +46,11 @@ model Session {
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
name String?
|
||||
email String? @unique
|
||||
id String @id @default(uuid())
|
||||
firstname String
|
||||
lastname String
|
||||
email String @unique
|
||||
password String
|
||||
emailVerified DateTime? @map(name: "email_verified")
|
||||
image String?
|
||||
createdAt DateTime @default(now()) @map(name: "created_at")
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import js from "@eslint/js";
|
||||
import eslintConfigPrettier from "eslint-config-prettier";
|
||||
import turboPlugin from "eslint-plugin-turbo";
|
||||
import tseslint from "typescript-eslint";
|
||||
import onlyWarn from "eslint-plugin-only-warn";
|
||||
import js from '@eslint/js';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||
import turboPlugin from 'eslint-plugin-turbo';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import onlyWarn from 'eslint-plugin-only-warn';
|
||||
|
||||
/**
|
||||
* A shared ESLint configuration for the repository.
|
||||
@@ -18,7 +18,7 @@ export const config = [
|
||||
turbo: turboPlugin,
|
||||
},
|
||||
rules: {
|
||||
"turbo/no-undeclared-env-vars": "warn",
|
||||
'turbo/no-undeclared-env-vars': ['error', { allowList: true }],
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -27,6 +27,6 @@ export const config = [
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ["dist/**"],
|
||||
ignores: ['dist/**'],
|
||||
},
|
||||
];
|
||||
|
||||
25
turbo.json
25
turbo.json
@@ -1,9 +1,19 @@
|
||||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"globalDependencies": ["**/.env.*local"],
|
||||
"globalEnv": ["EMAIL_SERVER", "EMAIL_FROM", "SECRET"],
|
||||
"ui": "tui",
|
||||
"tasks": {
|
||||
"db:generate": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"db:migrate": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"dependsOn": ["^build", "db:generate", "db:migrate"],
|
||||
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
||||
"outputs": [".next/**", "!.next/cache/**"]
|
||||
},
|
||||
@@ -14,19 +24,10 @@
|
||||
"dependsOn": ["^check-types"]
|
||||
},
|
||||
"dev": {
|
||||
"dependsOn": ["^db:generate"],
|
||||
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"db:generate": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"db:migrate": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"db:deploy": {
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user