Skip to content

Commit ad892bf

Browse files
committed
Fixing purge host to respect local better
1 parent 6072a71 commit ad892bf

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Changelog for `react-static-web-apps-auth`
22

3+
## [1.7.2] - 2024-03-27
4+
5+
### Fixed
6+
7+
- Localhost path for user perge didn't respect port number or prototcol
8+
39
## [1.7.1] - 2024-03-26
410

5-
## Added
11+
### Added
612

713
- Custom render function support for User Purge component
814

react-static-web-apps-auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aaronpowell/react-static-web-apps-auth",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"description": "A library to help creating authenticated React apps on Azure Static Web Apps",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

react-static-web-apps-auth/src/UserPurge.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ const UserPurge = ({
1919
label?: string;
2020
customRenderer?: (props: UserPurgeRenderProps) => JSX.Element;
2121
}) => {
22-
const host = globally ? "identity.azurestaticapps.net" : location.hostname;
23-
const href = `https://${host}/.auth/purge/${provider}`;
22+
const host = globally
23+
? "https://identity.azurestaticapps.net"
24+
: location.origin;
25+
const href = `${host}/.auth/purge/${provider}`;
2426
const className = `purge ${StaticWebAppsClassName}`;
2527

2628
return customRenderer ? (

0 commit comments

Comments
 (0)