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:
parent
2747a1064e
commit
07e04eac55
1 changed files with 48 additions and 42 deletions
|
@ -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());
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue