Skip to content

Commit 5bfc6ba

Browse files
committed
fix: extra protection for edge cases
1 parent 1397043 commit 5bfc6ba

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/state/KindeProvider.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,13 @@ export const KindeProvider = ({
553553
const init = useCallback(async () => {
554554
if (initRef.current) return;
555555
try {
556-
await checkAuth({ domain, clientId });
557-
initRef.current = true;
556+
try {
557+
await checkAuth({ domain, clientId });
558+
} catch (err) {
559+
console.warn("checkAuth failed:", err);
560+
setState((v: ProviderState) => ({ ...v, isLoading: false }));
561+
}
562+
initRef.current = true;
558563
const params = new URLSearchParams(window.location.search);
559564

560565
if (params.has("error")) {
@@ -611,6 +616,7 @@ export const KindeProvider = ({
611616
window.location.origin,
612617
);
613618
window.close();
619+
return;
614620
}
615621
await processAuthResult(new URLSearchParams(window.location.search));
616622
} finally {

0 commit comments

Comments
 (0)