@orangecheck/auth-client 2.32.3 → 2.33.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@orangecheck/auth-client`
2
2
 
3
- > **Full reference:** [docs.ochk.io/sdk/auth-client](https://docs.ochk.io/sdk/auth-client) — auto-generated from the TypeScript source on every release.
3
+ > **Full reference:** [ochk.io/docs/sdk/auth-client](https://ochk.io/docs/sdk/auth-client) — auto-generated from the TypeScript source on every release.
4
4
  > Hand-written prose below is the high-level overview; the docs site is the source of truth for every export, type, and signature.
5
5
 
6
6
 
@@ -16,8 +16,8 @@ Pairs with [`@orangecheck/auth-core`](../auth-core) on the server side.
16
16
  > OrangeCheck *be* your sign-in. If you already run your own login
17
17
  > (Google, Auth0, Clerk, NextAuth, …) and just want to add a `did:oc`
18
18
  > to your users, you don't need this package — see
19
- > [OrangeCheck Connect](https://docs.ochk.io/connect). Both pathways are
20
- > compared at [docs.ochk.io/integration](https://docs.ochk.io/integration).
19
+ > [OrangeCheck Connect](https://ochk.io/docs/connect). Both pathways are
20
+ > compared at [ochk.io/docs/integration](https://ochk.io/docs/integration).
21
21
 
22
22
  ## Install
23
23
 
package/dist/index.js CHANGED
@@ -871,6 +871,10 @@ function OcAccountPill({
871
871
  }
872
872
  );
873
873
  }
874
+ function accountAddress(account) {
875
+ if (account?.primaryBtc) return account.primaryBtc;
876
+ return account?.displayIdentity?.kind === "btc" ? account.displayIdentity.value : null;
877
+ }
874
878
  function useOcAddressSuggestion(options) {
875
879
  const {
876
880
  value,
@@ -880,7 +884,7 @@ function useOcAddressSuggestion(options) {
880
884
  suggestionClassName
881
885
  } = options;
882
886
  const { status, account } = useOcSession();
883
- const sessionAddress = status === "authenticated" ? account?.primaryBtc ?? null : null;
887
+ const sessionAddress = status === "authenticated" ? accountAddress(account) : null;
884
888
  const [open, setOpen] = React4__namespace.useState(false);
885
889
  const [highlighted, setHighlighted] = React4__namespace.useState(false);
886
890
  const blurTimer = React4__namespace.useRef(null);
@@ -1012,7 +1016,7 @@ var OcAddressInput = React4__namespace.forwardRef(
1012
1016
  ...rest
1013
1017
  }, forwardedRef) {
1014
1018
  const { status, account } = useOcSession();
1015
- const sessionAddress = status === "authenticated" ? account?.primaryBtc ?? null : null;
1019
+ const sessionAddress = status === "authenticated" ? accountAddress(account) : null;
1016
1020
  const [open, setOpen] = React4__namespace.useState(false);
1017
1021
  const [highlighted, setHighlighted] = React4__namespace.useState(false);
1018
1022
  const innerRef = React4__namespace.useRef(null);