Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sveltekit) - client functions not working in latest patch #12751

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix baseUrl that was broken in the previous patch
  • Loading branch information
jaysin586 committed Mar 8, 2025
commit 597f78f752b0c50f43af475f94b50ef35b89aba4
4 changes: 2 additions & 2 deletions packages/frameworks-sveltekit/src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function signIn<Redirect extends boolean = true>(
...signInParams
} = rest

const baseUrl = base ?? ""
const baseUrl = `${base}/auth`

const signInUrl = `${baseUrl}/${
provider === "credentials" ? "callback" : "signin"
Expand Down Expand Up @@ -150,7 +150,7 @@ export async function signOut<R extends boolean = true>(
redirectTo = options?.callbackUrl ?? window.location.href,
} = options ?? {}

const baseUrl = base ?? ""
const baseUrl = `${base}/auth`
const res = await fetch(`${baseUrl}/signout`, {
method: "post",
headers: {
Expand Down
4 changes: 2 additions & 2 deletions packages/frameworks-sveltekit/src/lib/webauthn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function webAuthnOptions(
providerID: ProviderId,
options?: Omit<SignInOptions, "redirect">
) {
const baseUrl = base ?? ""
const baseUrl = `${base}/auth`

// @ts-expect-error
const params = new URLSearchParams(options)
Expand Down Expand Up @@ -72,7 +72,7 @@ export async function signIn<Redirect extends boolean = true>(
...signInParams
} = rest

const baseUrl = base ?? ""
const baseUrl = `${base}/auth`

if (!provider || provider !== "webauthn") {
// TODO: Add docs link with explanation
Expand Down