Skip to content

Commit 9f7f9fd

Browse files
Merge pull request #27 from aws-samples/fix/root-redirect-loop
🐛 fix(web-ui): prevent infinite redirect when returnUrl is /
2 parents a866a8b + 0ab933b commit 9f7f9fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎web-ui/src/app/(authenticated)/page.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function RootPage() {
1515
useEffect(() => {
1616
const returnUrl = sessionStorage.getItem("post_signin_return_url")
1717
console.log("[RootPage] returnUrl from sessionStorage:", returnUrl)
18-
if (returnUrl) {
18+
if (returnUrl && returnUrl !== "/") {
1919
sessionStorage.removeItem("post_signin_return_url")
2020
router.replace(returnUrl)
2121
} else {

0 commit comments

Comments
 (0)