UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 984 B
import e from"../../../../utils/errors/lucid-api-error.mjs";import t from"../../../../services/auth/access-token/clear-token.mjs";import n from"../../../../services/auth/csrf/clear-token.mjs";import r from"../../../../services/auth/refresh-token/clear-token.mjs";import i from"../../middleware/authenticate.mjs";import a from"../../middleware/validate-csrf.mjs";import o from"../../openapi/index.mjs";import{createFactory as s}from"hono/factory";import{describeRoute as c}from"hono-openapi";const l=s().createHandlers(c({description:`Logs out a user by clearing the refresh token and access token, it also clears the CSRF token.`,tags:[`auth`],summary:`Logout`,responses:o.responses(),parameters:o.parameters({headers:{csrf:!0}})}),a,i(),async i=>{let[a,o,s]=await Promise.all([r(i),t(i),n(i)]);if(a.error)throw new e(a.error);if(o.error)throw new e(o.error);if(s.error)throw new e(s.error);return i.status(204),i.body(null)});export{l as default}; //# sourceMappingURL=logout.mjs.map