UNPKG

@lucidcms/core

Version:

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

2 lines 629 B
import{copy as e}from"../../../libs/i18n/copy.mjs";import t from"../../../constants/constants.mjs";import{getCookie as n}from"hono/cookie";import{verify as r}from"hono/jwt";const i=async i=>{try{let a=i.get(`config`),o=n(i,t.cookies.accessToken);return o?{error:void 0,data:await r(o,a.secrets.accessToken,t.jwt.algorithm)}:{error:{type:`authorisation`,code:`authorisation`,message:e(`server:core.permissions.unauthorized`)},data:void 0}}catch{return{error:{type:`authorisation`,code:`authorisation`,message:e(`server:core.permissions.unauthorized`)},data:void 0}}};export{i as default}; //# sourceMappingURL=verify-token.mjs.map