Repository navigation
fix(sveltekit): support external redirect permissions - #1200
Conversation
|
Unfortunately, I forgot to include a check for Svelte version >= 3.0.0. |
|
@gerold-penz Thanks for the contribution! I've pushed an update directly to your PR in 5b42b81. The SDK now always allows redirects to Logto for sign-in and sign-out. For external I also removed the runtime version check, addressed the type compatibility between SvelteKit 2 and 3, and added tests and configuration documentation. Could you try this version in your application and confirm whether it meets your needs? |
5b42b81 to
f34684e
Compare
@charIeszhao Hi, I tried the file https://github.com/gerold-penz/logto-js/blob/sveltekit-redirect/packages/sveltekit/src/index.ts in my program. |
See the external redirects section in the SvelteKit 3 migration guide: https://svelte.dev/docs/kit/migrating-to-sveltekit-3
f34684e to
b0aee58
Compare
|
@gerold-penz Thanks, a new version should be already available on NPM. Let me know if there's any other issues |
Summary
Support SvelteKit 3's explicit permission requirement for external redirects while preserving SvelteKit 2 behavior.
HookConfig.allowExternalPostRedirectUri(defaultfalse) to opt into external post-sign-in destinations on SvelteKit 3+. SvelteKit 2 ignores the option and retains its existing behavior. URL validation remains SvelteKit's responsibility.sequenceto support theHandletype relocation in SvelteKit 3.Testing
javascript:/data:destinations. SvelteKit 3 validation used its request context and Node 22.20.0.Checklist
.changesetReference: https://svelte.dev/docs/kit/migrating-to-sveltekit-3#Miscellaneous-External-redirects-must-be-opted-into