Skip to content

Commit

Permalink
Fixing purge host to respect local better
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronpowell committed Mar 27, 2024
1 parent 6072a71 commit ad892bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Changelog for `react-static-web-apps-auth`

## [1.7.2] - 2024-03-27

### Fixed

- Localhost path for user perge didn't respect port number or prototcol

## [1.7.1] - 2024-03-26

## Added
### Added

- Custom render function support for User Purge component

Expand Down
2 changes: 1 addition & 1 deletion react-static-web-apps-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aaronpowell/react-static-web-apps-auth",
"version": "1.7.1",
"version": "1.7.2",
"description": "A library to help creating authenticated React apps on Azure Static Web Apps",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
6 changes: 4 additions & 2 deletions react-static-web-apps-auth/src/UserPurge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ const UserPurge = ({
label?: string;
customRenderer?: (props: UserPurgeRenderProps) => JSX.Element;
}) => {
const host = globally ? "identity.azurestaticapps.net" : location.hostname;
const href = `https://${host}/.auth/purge/${provider}`;
const host = globally
? "https://identity.azurestaticapps.net"
: location.origin;
const href = `${host}/.auth/purge/${provider}`;
const className = `purge ${StaticWebAppsClassName}`;

return customRenderer ? (
Expand Down

0 comments on commit ad892bf

Please sign in to comment.