Edit: /tmp/tsx-0/17887-40417d0b751f2afca52adf368f0677e72f9f4d1c (30110B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/api/routes/update-user.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 update_user_exports={};__export(update_user_exports,{changeEmail:()=>changeEmail,changePassword:()=>changePassword,deleteUser:()=>deleteUser,deleteUserCallback:()=>deleteUserCallback,setPassword:()=>setPassword,updateUser:()=>updateUser});module.exports=__toCommonJS(update_user_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_random=require(\"../../crypto/random.mjs\");var import_crypto=require(\"../../crypto/index.mjs\");var import_cookies=require(\"../../cookies/index.mjs\");var import_session=require(\"./session.mjs\");var import_email_verification=require(\"./email-verification.mjs\");var import_error=require(\"@better-auth/core/error\");var import_api=require(\"@better-auth/core/api\");var z=__toESM(require(\"zod\"));const updateUserBodySchema=z.record(z.string().meta({description:\"Field name must be a string\"}),z.any());const updateUser=__name(()=>(0,import_api.createAuthEndpoint)(\"/update-user\",{method:\"POST\",operationId:\"updateUser\",body:updateUserBodySchema,use:[import_session.sessionMiddleware],metadata:{$Infer:{body:{}},openapi:{operationId:\"updateUser\",description:\"Update the current user\",requestBody:{content:{\"application/json\":{schema:{type:\"object\",properties:{name:{type:\"string\",description:\"The name of the user\"},image:{type:\"string\",description:\"The image of the user\",nullable:true}}}}}},responses:{\"200\":{description:\"Success\",content:{\"application/json\":{schema:{type:\"object\",properties:{user:{type:\"object\",$ref:\"#/components/schemas/User\"}}}}}}}}}},async ctx=>{const body=ctx.body;if(typeof body!==\"object\"||Array.isArray(body))throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.BODY_MUST_BE_AN_OBJECT);if(body.email)throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.EMAIL_CAN_NOT_BE_UPDATED);const{name,image,...rest}=body;const session=ctx.context.session;const additionalFields=(0,import_schema.parseUserInput)(ctx.context.options,rest,\"update\");if(image===void 0&&name===void 0&&Object.keys(additionalFields).length===0)throw import_error.APIError.fromStatus(\"BAD_REQUEST\",{message:\"No fields to update\"});const updatedUser=await ctx.context.internalAdapter.updateUser(session.user.id,{name,image,...additionalFields})??{...session.user,...name!==void 0&&{name},...image!==void 0&&{image},...additionalFields};await(0,import_cookies.setSessionCookie)(ctx,{session:session.session,user:updatedUser});return ctx.json({status:true})}),\"updateUser\");const changePassword=(0,import_api.createAuthEndpoint)(\"/change-password\",{method:\"POST\",operationId:\"changePassword\",body:z.object({newPassword:z.string().meta({description:\"The new password to set\"}),currentPassword:z.string().meta({description:\"The current password is required\"}),revokeOtherSessions:z.boolean().meta({description:\"Must be a boolean value\"}).optional()}),use:[import_session.sensitiveSessionMiddleware],metadata:{openapi:{operationId:\"changePassword\",description:\"Change the password of the user\",responses:{\"200\":{description:\"Password successfully changed\",content:{\"application/json\":{schema:{type:\"object\",properties:{token:{type:\"string\",nullable:true,description:\"New session token if other sessions were revoked\"},user:{type:\"object\",properties:{id:{type:\"string\",description:\"The unique identifier of the user\"},email:{type:\"string\",format:\"email\",description:\"The email address of the user\"},name:{type:\"string\",description:\"The name of the user\"},image:{type:\"string\",format:\"uri\",nullable:true,description:\"The profile image URL of the user\"},emailVerified:{type:\"boolean\",description:\"Whether the email has been verified\"},createdAt:{type:\"string\",format:\"date-time\",description:\"When the user was created\"},updatedAt:{type:\"string\",format:\"date-time\",description:\"When the user was last updated\"}},required:[\"id\",\"email\",\"name\",\"emailVerified\",\"createdAt\",\"updatedAt\"]}},required:[\"user\"]}}}}}}}},async ctx=>{const{newPassword,currentPassword,revokeOtherSessions}=ctx.body;const session=ctx.context.session;const minPasswordLength=ctx.context.password.config.minPasswordLength;if(newPassword.length
maxPasswordLength){ctx.context.logger.error(\"Password is too long\");throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.PASSWORD_TOO_LONG)}const account=(await ctx.context.internalAdapter.findAccounts(session.user.id)).find(account2=>account2.providerId===\"credential\"&&account2.password);if(!account||!account.password)throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.CREDENTIAL_ACCOUNT_NOT_FOUND);const passwordHash=await ctx.context.password.hash(newPassword);if(!await ctx.context.password.verify({hash:account.password,password:currentPassword}))throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.INVALID_PASSWORD);await ctx.context.internalAdapter.updateAccount(account.id,{password:passwordHash});let token=null;if(revokeOtherSessions){await ctx.context.internalAdapter.deleteSessions(session.user.id);const newSession=await ctx.context.internalAdapter.createSession(session.user.id);if(!newSession)throw import_error.APIError.from(\"INTERNAL_SERVER_ERROR\",import_error.BASE_ERROR_CODES.FAILED_TO_GET_SESSION);await(0,import_cookies.setSessionCookie)(ctx,{session:newSession,user:session.user});token=newSession.token}return ctx.json({token,user:(0,import_schema.parseUserOutput)(ctx.context.options,session.user)})});const setPassword=(0,import_api.createAuthEndpoint)({method:\"POST\",body:z.object({newPassword:z.string().meta({description:\"The new password to set is required\"})}),use:[import_session.sensitiveSessionMiddleware]},async ctx=>{const{newPassword}=ctx.body;const session=ctx.context.session;const minPasswordLength=ctx.context.password.config.minPasswordLength;if(newPassword.lengthmaxPasswordLength){ctx.context.logger.error(\"Password is too long\");throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.PASSWORD_TOO_LONG)}const account=(await ctx.context.internalAdapter.findAccounts(session.user.id)).find(account2=>account2.providerId===\"credential\"&&account2.password);const passwordHash=await ctx.context.password.hash(newPassword);if(!account){await ctx.context.internalAdapter.linkAccount({userId:session.user.id,providerId:\"credential\",accountId:session.user.id,password:passwordHash});return ctx.json({status:true})}throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.PASSWORD_ALREADY_SET)});const deleteUser=(0,import_api.createAuthEndpoint)(\"/delete-user\",{method:\"POST\",use:[import_session.sensitiveSessionMiddleware],body:z.object({callbackURL:z.string().meta({description:\"The callback URL to redirect to after the user is deleted\"}).optional(),password:z.string().meta({description:\"The password of the user is required to delete the user\"}).optional(),token:z.string().meta({description:\"The token to delete the user is required\"}).optional()}),metadata:{openapi:{operationId:\"deleteUser\",description:\"Delete the user\",requestBody:{content:{\"application/json\":{schema:{type:\"object\",properties:{callbackURL:{type:\"string\",description:\"The callback URL to redirect to after the user is deleted\"},password:{type:\"string\",description:\"The user's password. Required if session is not fresh\"},token:{type:\"string\",description:\"The deletion verification token\"}}}}}},responses:{\"200\":{description:\"User deletion processed successfully\",content:{\"application/json\":{schema:{type:\"object\",properties:{success:{type:\"boolean\",description:\"Indicates if the operation was successful\"},message:{type:\"string\",enum:[\"User deleted\",\"Verification email sent\"],description:\"Status message of the deletion process\"}},required:[\"success\",\"message\"]}}}}}}}},async ctx=>{if(!ctx.context.options.user?.deleteUser?.enabled){ctx.context.logger.error(\"Delete user is disabled. Enable it in the options\");throw import_error.APIError.fromStatus(\"NOT_FOUND\")}const session=ctx.context.session;if(ctx.body.password){const account=(await ctx.context.internalAdapter.findAccounts(session.user.id)).find(account2=>account2.providerId===\"credential\"&&account2.password);if(!account||!account.password)throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.CREDENTIAL_ACCOUNT_NOT_FOUND);if(!await ctx.context.password.verify({hash:account.password,password:ctx.body.password}))throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.INVALID_PASSWORD)}if(ctx.body.token){await deleteUserCallback({...ctx,query:{token:ctx.body.token}});return ctx.json({success:true,message:\"User deleted\"})}if(ctx.context.options.user.deleteUser?.sendDeleteAccountVerification){const token=(0,import_random.generateRandomString)(32,\"0-9\",\"a-z\");await ctx.context.internalAdapter.createVerificationValue({value:session.user.id,identifier:`delete-account-${token}`,expiresAt:new Date(Date.now()+(ctx.context.options.user.deleteUser?.deleteTokenExpiresIn||3600*24)*1e3)});const url=`${ctx.context.baseURL}/delete-user/callback?token=${token}&callbackURL=${encodeURIComponent(ctx.body.callbackURL||\"/\")}`;await ctx.context.runInBackgroundOrAwait(ctx.context.options.user.deleteUser.sendDeleteAccountVerification({user:session.user,url,token},ctx.request));return ctx.json({success:true,message:\"Verification email sent\"})}if(!ctx.body.password&&ctx.context.sessionConfig.freshAge!==0){const currentAge=new Date(session.session.createdAt).getTime();const freshAge=ctx.context.sessionConfig.freshAge*1e3;if(Date.now()-currentAge>freshAge)throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.SESSION_EXPIRED)}const beforeDelete=ctx.context.options.user.deleteUser?.beforeDelete;if(beforeDelete)await beforeDelete(session.user,ctx.request);await ctx.context.internalAdapter.deleteUser(session.user.id);await ctx.context.internalAdapter.deleteSessions(session.user.id);(0,import_cookies.deleteSessionCookie)(ctx);const afterDelete=ctx.context.options.user.deleteUser?.afterDelete;if(afterDelete)await afterDelete(session.user,ctx.request);return ctx.json({success:true,message:\"User deleted\"})});const deleteUserCallback=(0,import_api.createAuthEndpoint)(\"/delete-user/callback\",{method:\"GET\",query:z.object({token:z.string().meta({description:\"The token to verify the deletion request\"}),callbackURL:z.string().meta({description:\"The URL to redirect to after deletion\"}).optional()}),use:[(0,import_origin_check.originCheck)(ctx=>ctx.query.callbackURL)],metadata:{openapi:{description:\"Callback to complete user deletion with verification token\",responses:{\"200\":{description:\"User successfully deleted\",content:{\"application/json\":{schema:{type:\"object\",properties:{success:{type:\"boolean\",description:\"Indicates if the deletion was successful\"},message:{type:\"string\",enum:[\"User deleted\"],description:\"Confirmation message\"}},required:[\"success\",\"message\"]}}}}}}}},async ctx=>{if(!ctx.context.options.user?.deleteUser?.enabled){ctx.context.logger.error(\"Delete user is disabled. Enable it in the options\");throw import_error.APIError.from(\"NOT_FOUND\",{message:\"Not found\",code:\"NOT_FOUND\"})}const session=await(0,import_session.getSessionFromCtx)(ctx);if(!session)throw import_error.APIError.from(\"NOT_FOUND\",import_error.BASE_ERROR_CODES.FAILED_TO_GET_USER_INFO);const token=await ctx.context.internalAdapter.findVerificationValue(`delete-account-${ctx.query.token}`);if(!token||token.expiresAt{if(!ctx.context.options.user?.changeEmail?.enabled){ctx.context.logger.error(\"Change email is disabled.\");throw import_error.APIError.fromStatus(\"BAD_REQUEST\",{message:\"Change email is disabled\"})}const newEmail=ctx.body.newEmail.toLowerCase();if(newEmail===ctx.context.session.user.email){ctx.context.logger.error(\"Email is the same\");throw import_error.APIError.fromStatus(\"BAD_REQUEST\",{message:\"Email is the same\"})}const canUpdateWithoutVerification=ctx.context.session.user.emailVerified!==true&&ctx.context.options.user.changeEmail.updateEmailWithoutVerification;const canSendConfirmation=ctx.context.session.user.emailVerified&&ctx.context.options.user.changeEmail.sendChangeEmailConfirmation;const canSendVerification=ctx.context.options.emailVerification?.sendVerificationEmail;if(!canUpdateWithoutVerification&&!canSendConfirmation&&!canSendVerification){ctx.context.logger.error(\"Verification email isn't enabled.\");throw import_error.APIError.fromStatus(\"BAD_REQUEST\",{message:\"Verification email isn't enabled\"})}if(await ctx.context.internalAdapter.findUserByEmail(newEmail)){await(0,import_email_verification.createEmailVerificationToken)(ctx.context.secret,ctx.context.session.user.email,newEmail,ctx.context.options.emailVerification?.expiresIn);ctx.context.logger.info(\"Change email attempt for existing email\");return ctx.json({status:true})}if(canUpdateWithoutVerification){await ctx.context.internalAdapter.updateUserByEmail(ctx.context.session.user.email,{email:newEmail});await(0,import_cookies.setSessionCookie)(ctx,{session:ctx.context.session.session,user:{...ctx.context.session.user,email:newEmail}});if(canSendVerification){const token2=await(0,import_email_verification.createEmailVerificationToken)(ctx.context.secret,newEmail,void 0,ctx.context.options.emailVerification?.expiresIn);const url2=`${ctx.context.baseURL}/verify-email?token=${token2}&callbackURL=${ctx.body.callbackURL||\"/\"}`;await ctx.context.runInBackgroundOrAwait(canSendVerification({user:{...ctx.context.session.user,email:newEmail},url:url2,token:token2},ctx.request))}return ctx.json({status:true})}if(canSendConfirmation){const token2=await(0,import_email_verification.createEmailVerificationToken)(ctx.context.secret,ctx.context.session.user.email,newEmail,ctx.context.options.emailVerification?.expiresIn,{requestType:\"change-email-confirmation\"});const url2=`${ctx.context.baseURL}/verify-email?token=${token2}&callbackURL=${ctx.body.callbackURL||\"/\"}`;await ctx.context.runInBackgroundOrAwait(canSendConfirmation({user:ctx.context.session.user,newEmail,url:url2,token:token2},ctx.request));return ctx.json({status:true})}if(!canSendVerification){ctx.context.logger.error(\"Verification email isn't enabled.\");throw import_error.APIError.fromStatus(\"BAD_REQUEST\",{message:\"Verification email isn't enabled\"})}const token=await(0,import_email_verification.createEmailVerificationToken)(ctx.context.secret,ctx.context.session.user.email,newEmail,ctx.context.options.emailVerification?.expiresIn,{requestType:\"change-email-verification\"});const url=`${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${ctx.body.callbackURL||\"/\"}`;await ctx.context.runInBackgroundOrAwait(canSendVerification({user:{...ctx.context.session.user,email:newEmail},url,token},ctx.request));return ctx.json({status:true})});0&&(module.exports={changeEmail,changePassword,deleteUser,deleteUserCallback,setPassword,updateUser});\n})()\n","warn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