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

fix(core): disabled session check for preview mode (#867)

disabled session check for preview mode
This commit is contained in:
simeng-li 2022-05-17 19:34:38 +08:00 committed by GitHub
parent 8a012a393d
commit 82674eea88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,8 @@ export default function koaSpaSessionGuard<
if (
!spaDistFiles.some((file) => requestPath.startsWith('/' + file)) &&
!ctx.request.path.endsWith(sessionNotFoundPath)
!ctx.request.path.endsWith(sessionNotFoundPath) &&
!ctx.request.URL.searchParams.get('preview') // Should not check session on preview mode
) {
ctx.redirect(sessionNotFoundPath);
}