Skip to content
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
73d308d
Fix Typescript compilation for 4.6.3
steaks Oct 21, 2024
ae52a6a
Add ReversingLabs Workflow (Don't Merge) (#782)
developerkunal Oct 31, 2024
7ffa7b4
feat(react 19): update react to 19, testing libraries deps to latest …
leefreemanxyz Dec 6, 2024
e7089f9
chore: update @types/react and @types/react-dom to version 19.0.0
leefreemanxyz Dec 6, 2024
e047c98
refactor: remove explicit return types for functional components in t…
leefreemanxyz Dec 23, 2024
c5bf472
update example code
tusharpandey13 Jan 15, 2025
284866e
package json changes
tusharpandey13 Jan 15, 2025
93f9ab8
update package-lock.json
tusharpandey13 Jan 19, 2025
e0f3ae7
fix example application
tusharpandey13 Jan 20, 2025
2f3580a
Release v2.3.0
tusharpandey13 Jan 21, 2025
83f22c6
fix npm release workflow
tusharpandey13 Jan 21, 2025
6ae6345
Revert "Release v2.3.0"
tusharpandey13 Jan 21, 2025
1caef84
Release v2.3.0
tusharpandey13 Jan 21, 2025
78f9c77
refactor: streamline dependency installation by removing artifact res…
gyaneshgouraw-okta Jun 24, 2025
53a80dd
Enhance type safety in Auth0Provider and reducer by introducing gener…
gyaneshgouraw-okta Jun 24, 2025
c5030f2
Add Skip the Auth0 login page to FAQ (#815)
frederikprijck Jul 9, 2025
9b56680
fix/cypress (#857)
gyaneshgouraw-okta Jul 17, 2025
e357baa
feat: Upgrade core dependencies and regenerate documentation (#856)
subhankarmaiti Jul 17, 2025
acad4b7
Bump @auth0/auth0-spa-js from 2.2.0 to 2.3.0 (#858)
dependabot[bot] Jul 18, 2025
3e88c00
Bump @typescript-eslint/eslint-plugin from 8.36.0 to 8.37.0 (#862)
dependabot[bot] Jul 18, 2025
a013dbd
Release v2.4.0 (#865)
gyaneshgouraw-okta Jul 22, 2025
fa9c117
Bump tmp from 0.2.3 to 0.2.4 (#873)
dependabot[bot] Aug 7, 2025
09f81f3
Bump @typescript-eslint/parser from 8.37.0 to 8.42.0 (#885)
dependabot[bot] Sep 5, 2025
4773407
Bump form-data from 4.0.1 to 4.0.4 (#866)
dependabot[bot] Sep 5, 2025
b118c29
Bump next from 15.3.5 to 15.4.7 in /examples/nextjs-app (#883)
dependabot[bot] Sep 5, 2025
d83d19c
Bump @testing-library/react from 16.1.0 to 16.3.0 (#861)
dependabot[bot] Sep 5, 2025
f4bfc44
Bump rollup-plugin-delete from 2.1.0 to 2.2.0 (#859)
dependabot[bot] Sep 5, 2025
c206c1b
Add support for DPoP (#869)
martinml Sep 15, 2025
3b9a945
Release v2.5.0 (#895)
gyaneshgouraw-okta Sep 17, 2025
53c5167
Merge branch 'main' into fix-typescript-4.6.3-compilation-issue
gyaneshgouraw-okta Sep 17, 2025
6db3c4d
Merge branch 'main' into fix-typescript-4.6.3-compilation-issue
gyaneshgouraw-okta Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ const CODE_RE = /[?&]code=[^&]+/;
const STATE_RE = /[?&]state=[^&]+/;
const ERROR_RE = /[?&]error=[^&]+/;

interface WithError {
error: string;
}

interface WithErrorAndDescription {
error: string;
error_description: string;
}

export const hasAuthParams = (searchParams = window.location.search): boolean =>
(CODE_RE.test(searchParams) || ERROR_RE.test(searchParams)) &&
STATE_RE.test(searchParams);
Expand All @@ -19,15 +28,17 @@ const normalizeErrorFn =
error !== null &&
typeof error === 'object' &&
'error' in error &&
typeof error.error === 'string'
typeof (error as WithError).error === 'string'
) {
if (
'error_description' in error &&
typeof error.error_description === 'string'
typeof (error as WithErrorAndDescription).error_description === 'string'
) {
return new OAuthError(error.error, error.error_description);
const e = error as WithErrorAndDescription;
return new OAuthError(e.error, e.error_description);
}
return new OAuthError(error.error);
const e = error as WithError;
return new OAuthError(e.error);
}
return new Error(fallbackMessage);
};
Expand Down
Loading