Skip to content

Commit 556ab03

Browse files
committed
fixing the redirect logic
1 parent 4105b5d commit 556ab03

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog for `react-static-web-apps-auth`
22

3+
## [0.1.7] - 2021-03-11
4+
5+
### Fixed
6+
7+
- Redirect URLs for login/logout didn't work due to a wrong query string
8+
39
## [0.1.6] - 2021-03-11
410

511
### Changed

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": "0.1.6",
3+
"version": "0.1.7",
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/Login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const Login = ({
1414
return (
1515
<a
1616
href={`/.auth/login/${id}${
17-
postLoginRedirect ? `?post_login_redirect=${postLoginRedirect}` : ""
17+
postLoginRedirect ? `?post_login_redirect_uri=${postLoginRedirect}` : ""
1818
}`}
1919
className={`${id} login ${StaticWebAppsClassName}`}
2020
>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { StaticWebAppsClassName } from "./constants";
44
const Logout = ({ postLogoutRedirect }: { postLogoutRedirect?: string }) => (
55
<a
66
href={`/.auth/logout${
7-
postLogoutRedirect ? `?post_logout_redirect=${postLogoutRedirect}` : ""
7+
postLogoutRedirect
8+
? `?post_logout_redirect_uri=${postLogoutRedirect}`
9+
: ""
810
}`}
911
className={`logout ${StaticWebAppsClassName}`}
1012
>

0 commit comments

Comments
 (0)