@authowl/react 0.20.0 → 0.21.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/{TeamsSection-OFWSOAZ6.js → TeamsSection-SHXAL64Q.js} +1 -1
- package/dist/{chunk-DPWUE5HS.js → chunk-K67DJJHP.js} +38 -0
- package/dist/index.cjs +2109 -2036
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +20 -1659
- package/dist/qr-ZNG4MAV5.js +1656 -0
- package/package.json +7 -7
|
@@ -574,6 +574,43 @@ function useOrganization() {
|
|
|
574
574
|
isLoaded: !isPending && orgLoaded
|
|
575
575
|
};
|
|
576
576
|
}
|
|
577
|
+
function useInvitationRecipientHint() {
|
|
578
|
+
const client = useAuthClient();
|
|
579
|
+
const apiRef = React5.useRef(client.organization);
|
|
580
|
+
apiRef.current = client.organization;
|
|
581
|
+
const [result, setResult] = React5.useState({
|
|
582
|
+
recipientHint: null,
|
|
583
|
+
isLoaded: false
|
|
584
|
+
});
|
|
585
|
+
React5.useEffect(() => {
|
|
586
|
+
let active = true;
|
|
587
|
+
const claim = readInvitationClaim();
|
|
588
|
+
if (!claim) {
|
|
589
|
+
setResult({ recipientHint: null, isLoaded: true });
|
|
590
|
+
return () => {
|
|
591
|
+
active = false;
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
void (async () => {
|
|
595
|
+
try {
|
|
596
|
+
const response = await apiRef.current.getInvitationRecipientHint({
|
|
597
|
+
invitationId: claim.id
|
|
598
|
+
});
|
|
599
|
+
if (!active) return;
|
|
600
|
+
setResult({
|
|
601
|
+
recipientHint: response.data?.recipientHint ?? null,
|
|
602
|
+
isLoaded: true
|
|
603
|
+
});
|
|
604
|
+
} catch {
|
|
605
|
+
if (active) setResult({ recipientHint: null, isLoaded: true });
|
|
606
|
+
}
|
|
607
|
+
})();
|
|
608
|
+
return () => {
|
|
609
|
+
active = false;
|
|
610
|
+
};
|
|
611
|
+
}, []);
|
|
612
|
+
return result;
|
|
613
|
+
}
|
|
577
614
|
function useOrganizationInvitation() {
|
|
578
615
|
const client = useAuthClient();
|
|
579
616
|
const apiRef = React5.useRef(client.organization);
|
|
@@ -889,6 +926,7 @@ export {
|
|
|
889
926
|
useUser,
|
|
890
927
|
useAuth,
|
|
891
928
|
useOrganization,
|
|
929
|
+
useInvitationRecipientHint,
|
|
892
930
|
useOrganizationInvitation,
|
|
893
931
|
useSignIn,
|
|
894
932
|
usePasskeys,
|