Edit: /tmp/tsx-0/17887-5e19da5b59a7098f3b862f00d79928b8d2477b1b (17911B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/plugins/username/index.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 username_exports={};__export(username_exports,{USERNAME_ERROR_CODES:()=>import_error_codes.USERNAME_ERROR_CODES,username:()=>username});module.exports=__toCommonJS(username_exports);var import_schema=require(\"../../db/schema.mjs\");var import_db=require(\"../../db/index.mjs\");var import_cookies=require(\"../../cookies/index.mjs\");var import_email_verification=require(\"../../api/routes/email-verification.mjs\");var import_api=require(\"../../api/index.mjs\");var import_error_codes=require(\"./error-codes.mjs\");var import_schema2=require(\"./schema.mjs\");var import_error=require(\"@better-auth/core/error\");var import_api2=require(\"@better-auth/core/api\");var z=__toESM(require(\"zod\"));function defaultUsernameValidator(username2){return/^[a-zA-Z0-9_.]+$/.test(username2)}__name(defaultUsernameValidator,\"defaultUsernameValidator\");const signInUsernameBodySchema=z.object({username:z.string().meta({description:\"The username of the user\"}),password:z.string().meta({description:\"The password of the user\"}),rememberMe:z.boolean().meta({description:\"Remember the user session\"}).optional(),callbackURL:z.string().meta({description:\"The URL to redirect to after email verification\"}).optional()});const isUsernameAvailableBodySchema=z.object({username:z.string().meta({description:\"The username to check\"})});const username=__name(options=>{const normalizer=__name(username2=>{if(options?.usernameNormalization===false)return username2;if(options?.usernameNormalization)return options.usernameNormalization(username2);return username2.toLowerCase()},\"normalizer\");const displayUsernameNormalizer=__name(displayUsername=>{return options?.displayUsernameNormalization?options.displayUsernameNormalization(displayUsername):displayUsername},\"displayUsernameNormalizer\");return{id:\"username\",init(ctx){return{options:{databaseHooks:{user:{create:{async before(user,context){const username2=\"username\"in user?user.username:null;const displayUsername=\"displayUsername\"in user?user.displayUsername:null;return{data:{...user,...username2?{username:normalizer(username2)}:{},...displayUsername?{displayUsername:displayUsernameNormalizer(displayUsername)}:{}}}}},update:{async before(user,context){const username2=\"username\"in user?user.username:null;const displayUsername=\"displayUsername\"in user?user.displayUsername:null;return{data:{...user,...username2?{username:normalizer(username2)}:{},...displayUsername?{displayUsername:displayUsernameNormalizer(displayUsername)}:{}}}}}}}}}},endpoints:{signInUsername:(0,import_api2.createAuthEndpoint)(\"/sign-in/username\",{method:\"POST\",body:signInUsernameBodySchema,metadata:{openapi:{summary:\"Sign in with username\",description:\"Sign in with username\",responses:{200:{description:\"Success\",content:{\"application/json\":{schema:{type:\"object\",properties:{token:{type:\"string\",description:\"Session token for the authenticated session\"},user:{$ref:\"#/components/schemas/User\"}},required:[\"token\",\"user\"]}}}},422:{description:\"Unprocessable Entity. Validation error\",content:{\"application/json\":{schema:{type:\"object\",properties:{message:{type:\"string\"}}}}}}}}}},async ctx=>{if(!ctx.body.username||!ctx.body.password){ctx.context.logger.error(\"Username or password not found\");throw import_error.APIError.from(\"UNAUTHORIZED\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME_OR_PASSWORD)}const username2=options?.validationOrder?.username===\"pre-normalization\"?normalizer(ctx.body.username):ctx.body.username;const minUsernameLength=options?.minUsernameLength||3;const maxUsernameLength=options?.maxUsernameLength||30;if(username2.length
maxUsernameLength){ctx.context.logger.error(\"Username too long\",{username:username2});throw import_error.APIError.from(\"UNPROCESSABLE_ENTITY\",import_error_codes.USERNAME_ERROR_CODES.USERNAME_TOO_LONG)}if(!await(options?.usernameValidator||defaultUsernameValidator)(username2))throw import_error.APIError.from(\"UNPROCESSABLE_ENTITY\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME);const user=await ctx.context.adapter.findOne({model:\"user\",where:[{field:\"username\",value:normalizer(username2)}]});if(!user){await ctx.context.password.hash(ctx.body.password);ctx.context.logger.error(\"User not found\",{username:username2});throw import_error.APIError.from(\"UNAUTHORIZED\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME_OR_PASSWORD)}const account=await ctx.context.adapter.findOne({model:\"account\",where:[{field:\"userId\",value:user.id},{field:\"providerId\",value:\"credential\"}]});if(!account)throw import_error.APIError.from(\"UNAUTHORIZED\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME_OR_PASSWORD);const currentPassword=account?.password;if(!currentPassword){ctx.context.logger.error(\"Password not found\",{username:username2});throw import_error.APIError.from(\"UNAUTHORIZED\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME_OR_PASSWORD)}if(!await ctx.context.password.verify({hash:currentPassword,password:ctx.body.password})){ctx.context.logger.error(\"Invalid password\");throw import_error.APIError.from(\"UNAUTHORIZED\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME_OR_PASSWORD)}if(ctx.context.options?.emailAndPassword?.requireEmailVerification&&!user.emailVerified){if(!ctx.context.options?.emailVerification?.sendVerificationEmail)throw import_error.APIError.from(\"FORBIDDEN\",import_error_codes.USERNAME_ERROR_CODES.EMAIL_NOT_VERIFIED);if(ctx.context.options?.emailVerification?.sendOnSignIn){const token=await(0,import_email_verification.createEmailVerificationToken)(ctx.context.secret,user.email,void 0,ctx.context.options.emailVerification?.expiresIn);const url=`${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${ctx.body.callbackURL||\"/\"}`;await ctx.context.runInBackgroundOrAwait(ctx.context.options.emailVerification.sendVerificationEmail({user,url,token},ctx.request))}throw import_error.APIError.from(\"FORBIDDEN\",import_error_codes.USERNAME_ERROR_CODES.EMAIL_NOT_VERIFIED)}const session=await ctx.context.internalAdapter.createSession(user.id,ctx.body.rememberMe===false);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},ctx.body.rememberMe===false);return ctx.json({token:session.token,user:(0,import_schema.parseUserOutput)(ctx.context.options,user)})}),isUsernameAvailable:(0,import_api2.createAuthEndpoint)(\"/is-username-available\",{method:\"POST\",body:isUsernameAvailableBodySchema},async ctx=>{const username2=ctx.body.username;if(!username2)throw import_error.APIError.from(\"UNPROCESSABLE_ENTITY\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME);const minUsernameLength=options?.minUsernameLength||3;const maxUsernameLength=options?.maxUsernameLength||30;if(username2.lengthmaxUsernameLength)throw import_error.APIError.from(\"UNPROCESSABLE_ENTITY\",import_error_codes.USERNAME_ERROR_CODES.USERNAME_TOO_LONG);if(!await(options?.usernameValidator||defaultUsernameValidator)(username2))throw import_error.APIError.from(\"UNPROCESSABLE_ENTITY\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME);if(await ctx.context.adapter.findOne({model:\"user\",where:[{field:\"username\",value:normalizer(username2)}]}))return ctx.json({available:false});return ctx.json({available:true})})},schema:(0,import_schema.mergeSchema)((0,import_schema2.getSchema)({username:normalizer,displayUsername:displayUsernameNormalizer}),options?.schema),hooks:{before:[{matcher(context){return context.path===\"/sign-up/email\"||context.path===\"/update-user\"},handler:(0,import_api2.createAuthMiddleware)(async ctx=>{const username2=typeof ctx.body.username===\"string\"&&options?.validationOrder?.username===\"post-normalization\"?normalizer(ctx.body.username):ctx.body.username;if(username2!==void 0&&typeof username2===\"string\"){const minUsernameLength=options?.minUsernameLength||3;const maxUsernameLength=options?.maxUsernameLength||30;if(username2.lengthmaxUsernameLength)throw import_error.APIError.from(\"BAD_REQUEST\",import_error_codes.USERNAME_ERROR_CODES.USERNAME_TOO_LONG);if(!await(options?.usernameValidator||defaultUsernameValidator)(username2))throw import_error.APIError.from(\"BAD_REQUEST\",import_error_codes.USERNAME_ERROR_CODES.INVALID_USERNAME);const user=await ctx.context.adapter.findOne({model:\"user\",where:[{field:\"username\",value:username2}]});const blockChangeSignUp=ctx.path===\"/sign-up/email\"&&user;const blockChangeUpdateUser=ctx.path===\"/update-user\"&&user&&ctx.context.session&&user.id!==ctx.context.session.session.userId;if(blockChangeSignUp||blockChangeUpdateUser)throw import_error.APIError.from(\"BAD_REQUEST\",import_error_codes.USERNAME_ERROR_CODES.USERNAME_IS_ALREADY_TAKEN)}const displayUsername=typeof ctx.body.displayUsername===\"string\"&&options?.validationOrder?.displayUsername===\"post-normalization\"?displayUsernameNormalizer(ctx.body.displayUsername):ctx.body.displayUsername;if(displayUsername!==void 0&&typeof displayUsername===\"string\"){if(options?.displayUsernameValidator){if(!await options.displayUsernameValidator(displayUsername))throw import_error.APIError.from(\"BAD_REQUEST\",import_error_codes.USERNAME_ERROR_CODES.INVALID_DISPLAY_USERNAME)}}})},{matcher(context){return context.path===\"/sign-up/email\"||context.path===\"/update-user\"},handler:(0,import_api2.createAuthMiddleware)(async ctx=>{if(ctx.body.username&&!ctx.body.displayUsername)ctx.body.displayUsername=ctx.body.username;if(ctx.body.displayUsername&&!ctx.body.username)ctx.body.username=ctx.body.displayUsername})}]},options,$ERROR_CODES:import_error_codes.USERNAME_ERROR_CODES}},\"username\");0&&(module.exports={USERNAME_ERROR_CODES,username});\n})()\n","warnings":[],"map":{"version":3,"mappings":";i/BAAA,4MAA6C,+BAC7C,cAAO,8BACP,mBAAiC,mCACjC,8BAA6C,mDAC7C,eAAO,+BACP,uBAAqC,6BACrC,IAAAA,eAA0B,wB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0BA,SAAQ,EAAG,MAAM,sBAAS,KAAK,cAAe,wCAAqB,gBAAgB,EACvJ,MAAM,KAAO,MAAM,IAAI,QAAQ,QAAQ,QAAQ,CAC9C,MAAO,OACP,MAAO,CAAC,CACP,MAAO,WACP,MAAOA,SACR,CAAC,CACF,CAAC,EACD,MAAM,kBAAoB,IAAI,OAAS,kBAAoB,KAC3D,MAAM,sBAAwB,IAAI,OAAS,gBAAkB,MAAQ,IAAI,QAAQ,SAAW,KAAK,KAAO,IAAI,QAAQ,QAAQ,QAAQ,OACpI,GAAI,mBAAqB,sBAAuB,MAAM,sBAAS,KAAK,cAAe,wCAAqB,yBAAyB,CAClI,CACA,MAAM,gBAAkB,OAAO,IAAI,KAAK,kBAAoB,UAAY,SAAS,iBAAiB,kBAAoB,qBAAuB,0BAA0B,IAAI,KAAK,eAAe,EAAI,IAAI,KAAK,gBAC5M,GAAI,kBAAoB,QAAU,OAAO,kBAAoB,SAAU,CACtE,GAAI,SAAS,yBAA0B,CACtC,GAAI,CAAC,MAAM,QAAQ,yBAAyB,eAAe,EAAG,MAAM,sBAAS,KAAK,cAAe,wCAAqB,wBAAwB,CAC/I,CACD,CACD,CAAC,CACF,EAAG,CACF,QAAQ,QAAS,CAChB,OAAO,QAAQ,OAAS,kBAAoB,QAAQ,OAAS,cAC9D,EACA,WAAS,kCAAqB,MAAO,KAAQ,CAC5C,GAAI,IAAI,KAAK,UAAY,CAAC,IAAI,KAAK,gBAAiB,IAAI,KAAK,gBAAkB,IAAI,KAAK,SACxF,GAAI,IAAI,KAAK,iBAAmB,CAAC,IAAI,KAAK,SAAU,IAAI,KAAK,SAAW,IAAI,KAAK,eAClF,CAAC,CACF,CAAC,CAAE,EACH,QACA,aAAc,uCACf,CACD,EA/MiB","names":["import_schema","import_api","username"],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/dist/plugins/username/index.mjs"],"sourcesContent":[null]}}