@orangecheck/auth-client 2.5.0 → 2.5.1

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.d.mts CHANGED
@@ -98,7 +98,7 @@ declare const OcAddressInput: React.ForwardRefExoticComponent<OcAddressInputProp
98
98
  interface OcSignInProps {
99
99
  audience: string;
100
100
  returnTo?: string;
101
- onSuccess?: (account: OcAccount) => void;
101
+ onSuccess?: (account: OcAccount, token?: string) => void;
102
102
  resolveReturnTo?: (account: OcAccount) => string | Promise<string>;
103
103
  authOrigin?: string;
104
104
  initialPath?: 'wallet' | 'email';
package/dist/index.d.ts CHANGED
@@ -98,7 +98,7 @@ declare const OcAddressInput: React.ForwardRefExoticComponent<OcAddressInputProp
98
98
  interface OcSignInProps {
99
99
  audience: string;
100
100
  returnTo?: string;
101
- onSuccess?: (account: OcAccount) => void;
101
+ onSuccess?: (account: OcAccount, token?: string) => void;
102
102
  resolveReturnTo?: (account: OcAccount) => string | Promise<string>;
103
103
  authOrigin?: string;
104
104
  initialPath?: 'wallet' | 'email';
package/dist/index.js CHANGED
@@ -795,9 +795,9 @@ function OcSignIn({
795
795
  const safeReturn = safeReturnTo(returnTo);
796
796
  const [path, setPath] = React4__namespace.useState(initialPath);
797
797
  const handleSuccess = React4__namespace.useCallback(
798
- async (account) => {
798
+ async (account, token) => {
799
799
  if (onSuccess) {
800
- onSuccess(account);
800
+ onSuccess(account, token);
801
801
  return;
802
802
  }
803
803
  if (resolveReturnTo) {
@@ -966,7 +966,7 @@ function WalletFlow({ authOrigin, audience, onSuccess }) {
966
966
  "reason" in json && json.reason || "error" in json && json.error || `verify_failed_${res.status}`
967
967
  );
968
968
  }
969
- onSuccess(json.account);
969
+ onSuccess(json.account, json.token);
970
970
  } catch (err) {
971
971
  const msg = err instanceof Error ? err.message : "sign-in failed";
972
972
  setError(msg);
@@ -1067,7 +1067,7 @@ function EmailFlow({ authOrigin, onSuccess }) {
1067
1067
  "reason" in json && json.reason || "error" in json && json.error || `verify failed (${res.status})`
1068
1068
  );
1069
1069
  }
1070
- onSuccess(json.account);
1070
+ onSuccess(json.account, json.token);
1071
1071
  } catch (err) {
1072
1072
  setCodeError(err instanceof Error ? err.message : "verify failed");
1073
1073
  } finally {