From 816b1a81a149281f8459a3a4a0613e43549da09e Mon Sep 17 00:00:00 2001 From: "colinjfagan@gmail.com" Date: Wed, 19 Nov 2025 21:42:01 -0800 Subject: [PATCH 1/4] update vanilla to allow full path specification --- packages/vanilla-js/CHANGELOG.md | 2 +- packages/vanilla-js/package.json | 2 +- packages/vanilla-js/src/AuthNClient/index.ts | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/vanilla-js/CHANGELOG.md b/packages/vanilla-js/CHANGELOG.md index 004b69d3a..b612c0c66 100644 --- a/packages/vanilla-js/CHANGELOG.md +++ b/packages/vanilla-js/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.1.16] - 2025-11-19 +## [0.1.17] - 2025-11-19 ### Added diff --git a/packages/vanilla-js/package.json b/packages/vanilla-js/package.json index 8157bd7de..fbe7e7585 100644 --- a/packages/vanilla-js/package.json +++ b/packages/vanilla-js/package.json @@ -1,7 +1,7 @@ { "name": "@pangeacyber/vanilla-js", "description": "Generic javascript integrations with Pangea", - "version": "0.1.16", + "version": "0.1.17", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "types": "dist/index.d.ts", diff --git a/packages/vanilla-js/src/AuthNClient/index.ts b/packages/vanilla-js/src/AuthNClient/index.ts index 9c885b56f..c95a108e4 100644 --- a/packages/vanilla-js/src/AuthNClient/index.ts +++ b/packages/vanilla-js/src/AuthNClient/index.ts @@ -156,6 +156,10 @@ export class AuthNClient { } if (!!this.config.apiPathPrefix) { + if (this.config.apiPathPrefix.startsWith("http")) { + return `${this.config.apiPathPrefix}${version_}${endpoint}`; + } + return `${window.location.origin}${this.config.apiPathPrefix}${version_}${endpoint}`; } From a8be8a6db706a8ba8c8f9fd83e554f2ef7dbe044 Mon Sep 17 00:00:00 2001 From: "colinjfagan@gmail.com" Date: Wed, 19 Nov 2025 21:44:13 -0800 Subject: [PATCH 2/4] update vanilla to allow full path specification --- packages/react-auth/CHANGELOG.md | 2 +- packages/react-auth/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-auth/CHANGELOG.md b/packages/react-auth/CHANGELOG.md index 39c3ed500..60efd51be 100644 --- a/packages/react-auth/CHANGELOG.md +++ b/packages/react-auth/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 0.0.19 - 2025-11-19 +## 0.0.20 - 2025-11-19 ### Changed diff --git a/packages/react-auth/package.json b/packages/react-auth/package.json index e669f8e55..f97e57066 100644 --- a/packages/react-auth/package.json +++ b/packages/react-auth/package.json @@ -1,7 +1,7 @@ { "name": "@pangeacyber/react-auth", "description": "Pangea auth provider React component", - "version": "0.0.19", + "version": "0.0.20", "type": "commonjs", "source": "src/index.ts", "main": "dist/index.cjs", @@ -39,7 +39,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@pangeacyber/vanilla-js": "0.1.16", + "@pangeacyber/vanilla-js": "0.1.17", "jose": "^6.1.0", "lodash": "^4.17.21" }, From 1074078b1d585ab28caad7795dd4d5122ccfbef9 Mon Sep 17 00:00:00 2001 From: "colinjfagan@gmail.com" Date: Wed, 19 Nov 2025 22:01:33 -0800 Subject: [PATCH 3/4] update vanilla to allow full path specification --- packages/react-auth/yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-auth/yarn.lock b/packages/react-auth/yarn.lock index dd5858e93..2ffe766cf 100644 --- a/packages/react-auth/yarn.lock +++ b/packages/react-auth/yarn.lock @@ -472,7 +472,7 @@ __metadata: "@arethetypeswrong/cli": "npm:^0.18.2" "@babel/core": "npm:^7.28.5" "@futureportal/parcel-transformer-package-version": "npm:^1.0.0" - "@pangeacyber/vanilla-js": "npm:0.1.16" + "@pangeacyber/vanilla-js": "npm:0.1.17" "@parcel/config-default": "npm:^2.16.1" "@parcel/packager-ts": "npm:^2.16.1" "@parcel/plugin": "npm:^2.16.1" @@ -496,12 +496,12 @@ __metadata: languageName: unknown linkType: soft -"@pangeacyber/vanilla-js@npm:0.1.16": - version: 0.1.16 - resolution: "@pangeacyber/vanilla-js@npm:0.1.16" +"@pangeacyber/vanilla-js@npm:0.1.17": + version: 0.1.17 + resolution: "@pangeacyber/vanilla-js@npm:0.1.17" dependencies: lodash: "npm:^4.17.21" - checksum: 10c0/20f27efd8433e199ac9a20d7f532fe5891f61d00e3ff71c6df20f62d5790863c15e14de3687a94982cf466ca852766fb59e2309c7b3cf3796b863fe7dd8a5e1a + checksum: 10c0/bd7fb7491d73fbc3f98f3d859ab6a46adbfd1e32f426393ffaa6d1f7cafcae9e07cf967fed1e06873eabce3448a927c5a3bedbf93f8ca9cd23872d9f46cbf500 languageName: node linkType: hard From c94ca064fdcc56069171f6fca28fb9da11ebdec1 Mon Sep 17 00:00:00 2001 From: "colinjfagan@gmail.com" Date: Mon, 24 Nov 2025 09:25:05 -0800 Subject: [PATCH 4/4] update to support callback --- packages/react-auth/CHANGELOG.md | 12 ++++++++++++ packages/react-auth/package.json | 2 +- .../react-auth/src/AuthProvider/index.tsx | 19 +++++++++++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/packages/react-auth/CHANGELOG.md b/packages/react-auth/CHANGELOG.md index 60efd51be..6e3b0ce40 100644 --- a/packages/react-auth/CHANGELOG.md +++ b/packages/react-auth/CHANGELOG.md @@ -5,12 +5,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.0.21 - 2025-11-25 + +### Changed + +- Support onRedirectCallback parameter + ## 0.0.20 - 2025-11-19 ### Changed - Upgraded @pangeacyber/vanilla-js auth client version +## 0.0.19 - 2025-11-19 + +### Changed + +- Upgraded @pangeacyber/vanilla-js auth client version + ### Added - Switch usePathApi to apiPathPrefix path parameter to AuthConfig diff --git a/packages/react-auth/package.json b/packages/react-auth/package.json index f97e57066..7a2b54516 100644 --- a/packages/react-auth/package.json +++ b/packages/react-auth/package.json @@ -1,7 +1,7 @@ { "name": "@pangeacyber/react-auth", "description": "Pangea auth provider React component", - "version": "0.0.20", + "version": "0.0.21", "type": "commonjs", "source": "src/index.ts", "main": "dist/index.cjs", diff --git a/packages/react-auth/src/AuthProvider/index.tsx b/packages/react-auth/src/AuthProvider/index.tsx index 88556b771..6b45699c9 100644 --- a/packages/react-auth/src/AuthProvider/index.tsx +++ b/packages/react-auth/src/AuthProvider/index.tsx @@ -81,6 +81,12 @@ export interface AuthProviderProps { */ redirectPathname?: string; + /** + * When passed in, AuthProvider will call this function when needing to redirect + * @example "/docs/"" + */ + onRedirectCallback?: (url: string) => void; + /** * When set to true users will be redirected to the hosted page on logout. * @@ -152,6 +158,7 @@ export const AuthProvider: FC = ({ cookieOptions = { useCookie: false }, redirectUri, redirectPathname, + onRedirectCallback, redirectOnLogout = false, useStrictStateCheck = true, passAuthMethod = false, @@ -378,7 +385,11 @@ export const AuthProvider: FC = ({ const redirectTo = loginURL; const url = queryParams ? `${redirectTo}?${queryParams}` : redirectTo; - window.location.replace(url); + if (onRedirectCallback) { + onRedirectCallback(url); + } else { + window.location.replace(url); + } }; const logout = useCallback(async () => { @@ -400,7 +411,11 @@ export const AuthProvider: FC = ({ const url = `${logoutURL}?${toUrlEncoded(query)}`; setLoggedOut(); - window.location.replace(url); + if (onRedirectCallback) { + onRedirectCallback(url); + } else { + window.location.replace(url); + } } // call the logout endpoint else {