Edit: /tmp/tsx-0/17887-a99d45070edf07ead8c836784ae7181f4ffd9d87 (18969B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/api/routes/email-verification.mjs\";(()=>{\nvar __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,\"default\",{value:mod,enumerable:true}):target,mod));var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var email_verification_exports={};__export(email_verification_exports,{createEmailVerificationToken:()=>createEmailVerificationToken,sendVerificationEmail:()=>sendVerificationEmail,sendVerificationEmailFn:()=>sendVerificationEmailFn,verifyEmail:()=>verifyEmail});module.exports=__toCommonJS(email_verification_exports);var import_origin_check=require(\"../middlewares/origin-check.mjs\");var import_middlewares=require(\"../middlewares/index.mjs\");var import_schema=require(\"../../db/schema.mjs\");var import_jwt=require(\"../../crypto/jwt.mjs\");var import_cookies=require(\"../../cookies/index.mjs\");var import_session=require(\"./session.mjs\");var import_error=require(\"@better-auth/core/error\");var import_api=require(\"@better-auth/core/api\");var z=__toESM(require(\"zod\"));var import_jose=require(\"jose\");var import_errors=require(\"jose/errors\");async function createEmailVerificationToken(secret,email,updateTo,expiresIn=3600,extraPayload){return await(0,import_jwt.signJWT)({email:email.toLowerCase(),updateTo,...extraPayload},secret,expiresIn)}__name(createEmailVerificationToken,\"createEmailVerificationToken\");async function sendVerificationEmailFn(ctx,user){if(!ctx.context.options.emailVerification?.sendVerificationEmail){ctx.context.logger.error(\"Verification email isn't enabled.\");throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.VERIFICATION_EMAIL_NOT_ENABLED)}const token=await createEmailVerificationToken(ctx.context.secret,user.email,void 0,ctx.context.options.emailVerification?.expiresIn);const callbackURL=ctx.body.callbackURL?encodeURIComponent(ctx.body.callbackURL):encodeURIComponent(\"/\");const url=`${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${callbackURL}`;await ctx.context.runInBackgroundOrAwait(ctx.context.options.emailVerification.sendVerificationEmail({user,url,token},ctx.request))}__name(sendVerificationEmailFn,\"sendVerificationEmailFn\");const sendVerificationEmail=(0,import_api.createAuthEndpoint)(\"/send-verification-email\",{method:\"POST\",operationId:\"sendVerificationEmail\",body:z.object({email:z.email().meta({description:\"The email to send the verification email to\"}),callbackURL:z.string().meta({description:\"The URL to use for email verification callback\"}).optional()}),metadata:{openapi:{operationId:\"sendVerificationEmail\",description:\"Send a verification email to the user\",requestBody:{content:{\"application/json\":{schema:{type:\"object\",properties:{email:{type:\"string\",description:\"The email to send the verification email to\",example:\"user@example.com\"},callbackURL:{type:\"string\",description:\"The URL to use for email verification callback\",example:\"https://example.com/callback\",nullable:true}},required:[\"email\"]}}}},responses:{\"200\":{description:\"Success\",content:{\"application/json\":{schema:{type:\"object\",properties:{status:{type:\"boolean\",description:\"Indicates if the email was sent successfully\",example:true}}}}}},\"400\":{description:\"Bad Request\",content:{\"application/json\":{schema:{type:\"object\",properties:{message:{type:\"string\",description:\"Error message\",example:\"Verification email isn't enabled\"}}}}}}}}}},async ctx=>{if(!ctx.context.options.emailVerification?.sendVerificationEmail){ctx.context.logger.error(\"Verification email isn't enabled.\");throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.VERIFICATION_EMAIL_NOT_ENABLED)}const{email}=ctx.body;const session=await(0,import_session.getSessionFromCtx)(ctx);if(!session){const user=await ctx.context.internalAdapter.findUserByEmail(email);if(!user||user.user.emailVerified){await createEmailVerificationToken(ctx.context.secret,email,void 0,ctx.context.options.emailVerification?.expiresIn);return ctx.json({status:true})}await sendVerificationEmailFn(ctx,user.user);return ctx.json({status:true})}if(session?.user.email!==email)throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.EMAIL_MISMATCH);if(session?.user.emailVerified)throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.EMAIL_ALREADY_VERIFIED);await sendVerificationEmailFn(ctx,session.user);return ctx.json({status:true})});const verifyEmail=(0,import_api.createAuthEndpoint)(\"/verify-email\",{method:\"GET\",operationId:\"verifyEmail\",query:z.object({token:z.string().meta({description:\"The token to verify the email\"}),callbackURL:z.string().meta({description:\"The URL to redirect to after email verification\"}).optional()}),use:[(0,import_origin_check.originCheck)(ctx=>ctx.query.callbackURL)],metadata:{openapi:{description:\"Verify the email of the user\",parameters:[{name:\"token\",in:\"query\",description:\"The token to verify the email\",required:true,schema:{type:\"string\"}},{name:\"callbackURL\",in:\"query\",description:\"The URL to redirect to after email verification\",required:false,schema:{type:\"string\"}}],responses:{\"200\":{description:\"Success\",content:{\"application/json\":{schema:{type:\"object\",properties:{user:{type:\"object\",$ref:\"#/components/schemas/User\"},status:{type:\"boolean\",description:\"Indicates if the email was verified successfully\"}},required:[\"user\",\"status\"]}}}}}}}},async ctx=>{function redirectOnError(error){if(ctx.query.callbackURL){if(ctx.query.callbackURL.includes(\"?\"))throw ctx.redirect(`${ctx.query.callbackURL}&error=${error.code}`);throw ctx.redirect(`${ctx.query.callbackURL}?error=${error.code}`)}throw import_error.APIError.from(\"UNAUTHORIZED\",error)}__name(redirectOnError,\"redirectOnError\");const{token}=ctx.query;let jwt;try{jwt=await(0,import_jose.jwtVerify)(token,new TextEncoder().encode(ctx.context.secret),{algorithms:[\"HS256\"]})}catch(e){if(e instanceof import_errors.JWTExpired)return redirectOnError(import_error.BASE_ERROR_CODES.TOKEN_EXPIRED);return redirectOnError(import_error.BASE_ERROR_CODES.INVALID_TOKEN)}const parsed=z.object({email:z.email(),updateTo:z.string().optional(),requestType:z.string().optional()}).parse(jwt.payload);const user=await ctx.context.internalAdapter.findUserByEmail(parsed.email);if(!user)return redirectOnError(import_error.BASE_ERROR_CODES.USER_NOT_FOUND);if(parsed.updateTo){const session=await(0,import_session.getSessionFromCtx)(ctx);if(session&&session.user.email!==parsed.email)return redirectOnError(import_error.BASE_ERROR_CODES.INVALID_USER);switch(parsed.requestType){case\"change-email-confirmation\":{const newToken=await createEmailVerificationToken(ctx.context.secret,parsed.email,parsed.updateTo,ctx.context.options.emailVerification?.expiresIn,{requestType:\"change-email-verification\"});const updateCallbackURL=ctx.query.callbackURL?encodeURIComponent(ctx.query.callbackURL):encodeURIComponent(\"/\");const url=`${ctx.context.baseURL}/verify-email?token=${newToken}&callbackURL=${updateCallbackURL}`;if(ctx.context.options.emailVerification?.sendVerificationEmail)await ctx.context.runInBackgroundOrAwait(ctx.context.options.emailVerification.sendVerificationEmail({user:{...user.user,email:parsed.updateTo},url,token:newToken},ctx.request));if(ctx.query.callbackURL)throw ctx.redirect(ctx.query.callbackURL);return ctx.json({status:true})}case\"change-email-verification\":{let activeSession=session;if(!activeSession){const newSession=await ctx.context.internalAdapter.createSession(user.user.id);if(!newSession)throw import_error.APIError.from(\"INTERNAL_SERVER_ERROR\",import_error.BASE_ERROR_CODES.FAILED_TO_CREATE_SESSION);activeSession={session:newSession,user:user.user}}const updatedUser2=await ctx.context.internalAdapter.updateUserByEmail(parsed.email,{email:parsed.updateTo,emailVerified:true});if(ctx.context.options.emailVerification?.afterEmailVerification)await ctx.context.options.emailVerification.afterEmailVerification(updatedUser2,ctx.request);await(0,import_cookies.setSessionCookie)(ctx,{session:activeSession.session,user:{...activeSession.user,email:parsed.updateTo,emailVerified:true}});if(ctx.query.callbackURL)throw ctx.redirect(ctx.query.callbackURL);return ctx.json({status:true,user:(0,import_schema.parseUserOutput)(ctx.context.options,updatedUser2)})}default:{let activeSession=session;if(!activeSession){const newSession=await ctx.context.internalAdapter.createSession(user.user.id);if(!newSession)throw import_error.APIError.from(\"INTERNAL_SERVER_ERROR\",import_error.BASE_ERROR_CODES.FAILED_TO_CREATE_SESSION);activeSession={session:newSession,user:user.user}}const updatedUser2=await ctx.context.internalAdapter.updateUserByEmail(parsed.email,{email:parsed.updateTo,emailVerified:false});const newToken=await createEmailVerificationToken(ctx.context.secret,parsed.updateTo);const updateCallbackURL=ctx.query.callbackURL?encodeURIComponent(ctx.query.callbackURL):encodeURIComponent(\"/\");if(ctx.context.options.emailVerification?.sendVerificationEmail)await ctx.context.runInBackgroundOrAwait(ctx.context.options.emailVerification.sendVerificationEmail({user:updatedUser2,url:`${ctx.context.baseURL}/verify-email?token=${newToken}&callbackURL=${updateCallbackURL}`,token:newToken},ctx.request));await(0,import_cookies.setSessionCookie)(ctx,{session:activeSession.session,user:{...activeSession.user,email:parsed.updateTo,emailVerified:false}});if(ctx.query.callbackURL)throw ctx.redirect(ctx.query.callbackURL);return ctx.json({status:true,user:(0,import_schema.parseUserOutput)(ctx.context.options,updatedUser2)})}}}if(user.user.emailVerified){if(ctx.query.callbackURL)throw ctx.redirect(ctx.query.callbackURL);return ctx.json({status:true,user:null})}if(ctx.context.options.emailVerification?.beforeEmailVerification)await ctx.context.options.emailVerification.beforeEmailVerification(user.user,ctx.request);const updatedUser=await ctx.context.internalAdapter.updateUserByEmail(parsed.email,{emailVerified:true});if(ctx.context.options.emailVerification?.afterEmailVerification)await ctx.context.options.emailVerification.afterEmailVerification(updatedUser,ctx.request);if(ctx.context.options.emailVerification?.autoSignInAfterVerification){const currentSession=await(0,import_session.getSessionFromCtx)(ctx);if(!currentSession||currentSession.user.email!==parsed.email){const session=await ctx.context.internalAdapter.createSession(user.user.id);if(!session)throw import_error.APIError.from(\"INTERNAL_SERVER_ERROR\",import_error.BASE_ERROR_CODES.FAILED_TO_CREATE_SESSION);await(0,import_cookies.setSessionCookie)(ctx,{session,user:{...user.user,emailVerified:true}})}else await(0,import_cookies.setSessionCookie)(ctx,{session:currentSession.session,user:{...currentSession.user,emailVerified:true}})}if(ctx.query.callbackURL)throw ctx.redirect(ctx.query.callbackURL);return ctx.json({status:true,user:null})});0&&(module.exports={createEmailVerificationToken,sendVerificationEmail,sendVerificationEmailFn,verifyEmail});\n})()\n","warnings":[],"map":{"version":3,"mappings":";i/BAAA,uVAA4B,2CAC5B,uBAAO,oCACP,kBAAgC,+BAChC,eAAwB,gCACxB,mBAAiC,mCACjC,mBAAkC,yBAClC,iBAA2C,mCAC3C,eAAmC,iCACnC,MAAmB,wBACnB,gBAA0B,gBAC1B,kBAA2B,uBAG3B,eAAe,6BAA6B,OAAQ,MAAO,SAAU,UAAY,KAAM,aAAc,CACpG,OAAO,QAAM,oBAAQ,CACpB,MAAO,MAAM,YAAY,EACzB,SACA,GAAG,YACJ,EAAG,OAAQ,SAAS,CACrB,CANe,oEAUf,eAAe,wBAAwB,IAAK,KAAM,CACjD,GAAI,CAAC,IAAI,QAAQ,QAAQ,mBAAmB,sBAAuB,CAClE,IAAI,QAAQ,OAAO,MAAM,mCAAmC,EAC5D,MAAM,sBAAS,KAAK,cAAe,8BAAiB,8BAA8B,CACnF,CACA,MAAM,MAAQ,MAAM,6BAA6B,IAAI,QAAQ,OAAQ,KAAK,MAAO,OAAQ,IAAI,QAAQ,QAAQ,mBAAmB,SAAS,EACzI,MAAM,YAAc,IAAI,KAAK,YAAc,mBAAmB,IAAI,KAAK,WAAW,EAAI,mBAAmB,GAAG,EAC5G,MAAM,IAAM,GAAG,IAAI,QAAQ,OAAO,uBAAuB,KAAK,gBAAgB,WAAW,GACzF,MAAM,IAAI,QAAQ,uBAAuB,IAAI,QAAQ,QAAQ,kBAAkB,sBAAsB,CACpG,KACA,IACA,KACD,EAAG,IAAI,OAAO,CAAC,C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KAAM,IACP,CAAC,CACF,CACA,GAAI,IAAI,QAAQ,QAAQ,mBAAmB,wBAAyB,MAAM,IAAI,QAAQ,QAAQ,kBAAkB,wBAAwB,KAAK,KAAM,IAAI,OAAO,EAC9J,MAAM,YAAc,MAAM,IAAI,QAAQ,gBAAgB,kBAAkB,OAAO,MAAO,CAAE,cAAe,IAAK,CAAC,EAC7G,GAAI,IAAI,QAAQ,QAAQ,mBAAmB,uBAAwB,MAAM,IAAI,QAAQ,QAAQ,kBAAkB,uBAAuB,YAAa,IAAI,OAAO,EAC9J,GAAI,IAAI,QAAQ,QAAQ,mBAAmB,4BAA6B,CACvE,MAAM,eAAiB,QAAM,kCAAkB,GAAG,EAClD,GAAI,CAAC,gBAAkB,eAAe,KAAK,QAAU,OAAO,MAAO,CAClE,MAAM,QAAU,MAAM,IAAI,QAAQ,gBAAgB,cAAc,KAAK,KAAK,EAAE,EAC5E,GAAI,CAAC,QAAS,MAAM,sBAAS,KAAK,wBAAyB,8BAAiB,wBAAwB,EACpG,QAAM,iCAAiB,IAAK,CAC3B,QACA,KAAM,CACL,GAAG,KAAK,KACR,cAAe,IAChB,CACD,CAAC,CACF,MAAO,QAAM,iCAAiB,IAAK,CAClC,QAAS,eAAe,QACxB,KAAM,CACL,GAAG,eAAe,KAClB,cAAe,IAChB,CACD,CAAC,CACF,CACA,GAAI,IAAI,MAAM,YAAa,MAAM,IAAI,SAAS,IAAI,MAAM,WAAW,EACnE,OAAO,IAAI,KAAK,CACf,OAAQ,KACR,KAAM,IACP,CAAC,CACF,CAAC","names":["updatedUser"],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/dist/api/routes/email-verification.mjs"],"sourcesContent":[null]}}