diff --git a/next.config.js b/next.config.js index ce43b208..a7a7256c 100644 --- a/next.config.js +++ b/next.config.js @@ -23,13 +23,17 @@ const nextConfig = { }, { protocol: 'https', - hostname: 'wwww.example.com', + hostname: 'lh3.googleusercontent.com', + // Change this to your CDN domain }, - { protocol: 'https', hostname: 'aakash2330.b-cdn.net', }, + { + protocol: 'https', + hostname: 'wwww.example.com', + }, ], }, }; diff --git a/prisma/seed.ts b/prisma/seed.ts index 214ae561..e17c7580 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -333,7 +333,7 @@ async function seedJobs() { currency: j.currency, application: j.application, city: faker.location.city(), - address: faker.location.streetAddress(), + address: faker.location.city(), hasExperiencerange: j.hasExperiencerange, minExperience: j.minExperience, maxExperience: j.maxExperience, diff --git a/src/actions/auth.actions.ts b/src/actions/auth.actions.ts index b582dfaa..9db6d30b 100644 --- a/src/actions/auth.actions.ts +++ b/src/actions/auth.actions.ts @@ -39,40 +39,46 @@ export const signUp = withServerActionAsyncCatcher< ); try { - await prisma.$transaction(async (txn) => { - const user = await txn.user.create({ - data: { ...data, password: hashedPassword }, - }); - - const verificationToken = await txn.verificationToken.create({ - data: { - identifier: user.id, - token: uuidv4(), - type: 'EMAIL_VERIFICATION', - }, - }); - - const confirmationLink = `${process.env.NEXTAUTH_URL}${APP_PATHS.VERIFY_EMAIL}/${verificationToken.token}`; - await sendConfirmationEmail( - data.email, - confirmationLink, - 'EMAIL_VERIFICATION' - ); - - cookies().set(PENDING_EMAIL_VERIFICATION_USER_ID, user.id, { - maxAge: 5 * 60, // 5 minutes - httpOnly: true, - secure: process.env.NODE_ENV === 'production', - }); - - return user; - }); + await prisma.$transaction( + async (txn) => { + const user = await txn.user.create({ + data: { ...data, password: hashedPassword }, + }); + + const verificationToken = await txn.verificationToken.create({ + data: { + identifier: user.id, + token: uuidv4(), + type: 'EMAIL_VERIFICATION', + }, + }); + + const confirmationLink = `${process.env.NEXTAUTH_URL}${APP_PATHS.VERIFY_EMAIL}/${verificationToken.token}`; + await sendConfirmationEmail( + data.email, + confirmationLink, + 'EMAIL_VERIFICATION' + ); + + cookies().set(PENDING_EMAIL_VERIFICATION_USER_ID, user.id, { + maxAge: 5 * 60, // 5 minutes + httpOnly: true, + secure: process.env.NODE_ENV === 'production', + }); + + return user; + }, + { + maxWait: 5000, + timeout: 20000, + } + ); return new SuccessResponse( 'User registered successfully. A verification link has been sent to your email.', 201 ).serialize(); - } catch { + } catch (_err) { throw new ErrorHandler( 'Registration Failed, please try again!', 'INTERNAL_SERVER_ERROR' diff --git a/src/actions/upload-to-cdn.ts b/src/actions/upload-to-cdn.ts index 935d0754..ca967570 100644 --- a/src/actions/upload-to-cdn.ts +++ b/src/actions/upload-to-cdn.ts @@ -26,7 +26,6 @@ export async function uploadFileAction(formData: FormData) { }, body: fileBuffer, }); - if (response.ok) { return { message: 'File uploaded successfully', diff --git a/src/app/create/page.tsx b/src/app/create/page.tsx index 428dad04..034eb1e6 100644 --- a/src/app/create/page.tsx +++ b/src/app/create/page.tsx @@ -10,6 +10,7 @@ const page = () => { 100xJobs is trusted by leading companies
+