0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

refactor(core): fix etag

This commit is contained in:
Gao Sun 2023-03-02 00:44:33 +08:00
parent 2747a1064e
commit 07e04eac55
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -17,7 +17,9 @@ export default function wellKnownRoutes<T extends AnonymousRouter>(
} = libraries; } = libraries;
if (id === adminTenantId) { if (id === adminTenantId) {
router.get('/.well-known/endpoints/:tenantId', async (ctx, next) => { router.get(
'/.well-known/endpoints/:tenantId',
async (ctx, next) => {
if (!ctx.params.tenantId) { if (!ctx.params.tenantId) {
throw new RequestError('request.invalid_input'); throw new RequestError('request.invalid_input');
} }
@ -27,10 +29,14 @@ export default function wellKnownRoutes<T extends AnonymousRouter>(
}; };
return next(); return next();
}); },
koaBodyEtag()
);
} }
router.get('/.well-known/sign-in-exp', async (ctx, next) => { router.get(
'/.well-known/sign-in-exp',
async (ctx, next) => {
const [signInExperience, logtoConnectors] = await Promise.all([ const [signInExperience, logtoConnectors] = await Promise.all([
getSignInExperience(), getSignInExperience(),
getLogtoConnectors(), getLogtoConnectors(),
@ -61,7 +67,7 @@ export default function wellKnownRoutes<T extends AnonymousRouter>(
}; };
return next(); return next();
}); },
koaBodyEtag()
router.use(koaBodyEtag()); );
} }