@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
2 lines • 1.12 kB
JavaScript
import{copy as e}from"../../../i18n/copy.mjs";import t from"../../../../utils/errors/lucid-api-error.mjs";import n from"../../../../services/account/cancel-email-change.mjs";import r from"../../utils/create-service-context.mjs";import i from"../../../../utils/services/service-wrapper.mjs";import a from"../../middleware/authenticate.mjs";import o from"../../middleware/validate-csrf.mjs";import s from"../../openapi/index.mjs";import{createFactory as c}from"hono/factory";import{describeRoute as l}from"hono-openapi";const u=c().createHandlers(l({description:`Cancels the authenticated user's pending email change.`,tags:[`account`],summary:`Cancel Pending Email Change`,responses:s.responses(),parameters:s.parameters({headers:{csrf:!0}})}),o,a(),async a=>{let o=r(a),s=await i(n,{transaction:!0,defaultError:{type:`basic`,name:e(`server:core.routes.cancel.email.change.error.name`),message:e(`server:core.routes.cancel.email.change.error.message`)}})(o,{userId:a.get(`auth`).id});if(s.error)throw new t(s.error);return a.status(204),a.body(null)});export{u as default};
//# sourceMappingURL=cancel-email-change.mjs.map