Skip to content

Commit

Permalink
Fix redirect param
Browse files Browse the repository at this point in the history
  • Loading branch information
kognise committed Mar 21, 2023
1 parent 7ce8eea commit d4b0414
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pages/migration-redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ export const post: APIRoute = async ({ request }) => {
return new Response(`
<script>
const puzzleLab = ${JSON.stringify(puzzleLab)}
const redirect = ${JSON.stringify(redirect)}
sessionStorage.setItem('migratedPuzzleLab', puzzleLab)
const search = new URLSearchParams(window.location.search)
window.location.replace(search.get('redirect') || '/migrate')
window.location.replace(redirect || '/migrate')
</script>
`, {
status: 200,
Expand Down

0 comments on commit d4b0414

Please sign in to comment.