fix: improve client-side submodules#12249
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
redirect: false for client signIn + OAuth
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12249 +/- ##
==========================================
- Coverage 39.77% 39.64% -0.13%
==========================================
Files 192 192
Lines 30371 30460 +89
Branches 1337 1337
==========================================
- Hits 12079 12076 -3
- Misses 18292 18384 +92 ☔ View full report in Codecov by Sentry. |
|
These changes seem to have changed the sveltkit signin and signout endpoints to |
| const _signInUrl = `${signInUrl}?${new URLSearchParams(authorizationParams)}` | ||
| const signInUrl = `${baseUrl}/${ | ||
| provider === "credentials" ? "callback" : "signin" | ||
| }/${provider}` |
There was a problem hiding this comment.
You are missing the /auth part of the path. This breaks the SvelteKit hooks.
| async function webAuthnOptions( | ||
| providerID: ProviderId, | ||
| options?: Omit<SignInOptions, "redirect"> | ||
| ) { | ||
| const baseUrl = base ?? "" | ||
|
|
||
| // @ts-expect-error | ||
| const params = new URLSearchParams(options) | ||
|
|
||
| const optionsResp = await fetch( | ||
| `${baseUrl}/webauthn-options/${providerId}?${params}` | ||
| `${baseUrl}/webauthn-options/${providerID}?${params}` |
There was a problem hiding this comment.
Similarly, this creates the same issue by removing /auth from the baseUrl
☕️ Reasoning
signInmethod.LiteralUniontyperedirect: falsefor OAuth providers in client-sidesignIn. We already allowed this for the server-side version. In some cases, you might just want the URL before redirecting viawindow.location.href, eg. you want to use a popup window to initiate the signin.signInandsignOutmethods. Now, unlessredirect: falseis explicitly added, these methods will returnvoid.@auth/core/client)🧢 Checklist
🎫 Affected issues
📌 Resources