0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

fix(core): fix preview session not found bug (#970)

* fix(core): fix preview session not found bug

fix preview session not found bug

* fix(core): cr fix

cr fix
This commit is contained in:
simeng-li 2022-05-27 19:58:40 +08:00 committed by GitHub
parent 8a07e939a3
commit 545a3929e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,10 @@ export default function koaSpaSessionGuard<
}
// Session guard
if (guardedPath.some((path) => requestPath.startsWith(path))) {
const isPreview = ctx.request.URL.searchParams.get('preview');
const isSessionRequiredPath = guardedPath.some((path) => requestPath.startsWith(path));
if (isSessionRequiredPath && !isPreview) {
try {
await provider.interactionDetails(ctx.req, ctx.res);
} catch {