UNPKG

@lucidcms/core

Version:

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

2 lines 1.39 kB
import{copy as e}from"../../../../i18n/copy.mjs";import t from"../../../../../constants/constants.mjs";import n from"../../../../../utils/errors/lucid-api-error.mjs";import r from"../../../../../services/auth/providers/get-providers.mjs";import i from"../../../utils/create-service-context.mjs";import a from"../../../../../utils/services/service-wrapper.mjs";import o from"../../../middleware/rate-limiter.mjs";import s from"../../../openapi/index.mjs";import c from"../../../utils/build-response.mjs";import{controllerSchemas as l}from"../../../../../schemas/auth.mjs";import{z as u}from"zod";import{minutesToMilliseconds as d}from"date-fns";import{createFactory as f}from"hono/factory";import{describeRoute as p}from"hono-openapi";const m=f().createHandlers(p({description:`Get all available authentication providers.`,tags:[`auth`],summary:`Get Auth Providers`,responses:s.responses({schema:u.toJSONSchema(l.getProviders.response)})}),o({mode:`ip`,limit:t.rateLimit.scopes.standard.limit,scope:t.rateLimit.scopes.standard.scopeKey,windowMs:d(1)}),async t=>{let o=i(t),s=await a(r,{transaction:!1,defaultError:{type:`basic`,name:e(`server:core.routes.providers.error.name`),message:e(`server:core.routes.providers.error.message`)}})(o);if(s.error)throw new n(s.error);return t.status(200),t.json(c(t,{data:s.data}))});export{m as default}; //# sourceMappingURL=get-providers.mjs.map