@fluxbase/sdk 2026.1.1-rc.2 → 2026.1.1-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -334,6 +334,7 @@ async function wrapAsyncVoid(operation) {
334
334
  // src/auth.ts
335
335
  var AUTH_STORAGE_KEY = "fluxbase.auth.session";
336
336
  var OAUTH_PROVIDER_KEY = "fluxbase.auth.oauth_provider";
337
+ var OAUTH_REDIRECT_URI_KEY = "fluxbase.auth.oauth_redirect_uri";
337
338
  var AUTO_REFRESH_TICK_THRESHOLD = 10;
338
339
  var AUTO_REFRESH_TICK_MINIMUM = 1e3;
339
340
  var MAX_REFRESH_RETRIES = 3;
@@ -926,14 +927,19 @@ var FluxbaseAuth = class {
926
927
  if (!provider) {
927
928
  throw new Error("No OAuth provider found. Call signInWithOAuth first.");
928
929
  }
930
+ const redirectUri = this.storage?.getItem(OAUTH_REDIRECT_URI_KEY);
929
931
  const params = new URLSearchParams({ code });
930
932
  if (state) {
931
933
  params.append("state", state);
932
934
  }
935
+ if (redirectUri) {
936
+ params.append("redirect_uri", redirectUri);
937
+ }
933
938
  const response = await this.fetch.get(
934
939
  `/api/v1/auth/oauth/${provider}/callback?${params.toString()}`
935
940
  );
936
941
  this.storage?.removeItem(OAUTH_PROVIDER_KEY);
942
+ this.storage?.removeItem(OAUTH_REDIRECT_URI_KEY);
937
943
  const session = {
938
944
  ...response,
939
945
  expires_at: Date.now() + response.expires_in * 1e3
@@ -957,6 +963,9 @@ var FluxbaseAuth = class {
957
963
  const url = result.data.url;
958
964
  if (typeof window !== "undefined") {
959
965
  this.storage?.setItem(OAUTH_PROVIDER_KEY, provider);
966
+ if (options?.redirect_uri) {
967
+ this.storage?.setItem(OAUTH_REDIRECT_URI_KEY, options.redirect_uri);
968
+ }
960
969
  window.location.href = url;
961
970
  } else {
962
971
  throw new Error(