Merged in fix/SW-3529-wl-site-logout-does-not-reload- (pull request #2947)

Fix/SW-3529 wl site logout does not reload
Approved-by: Anton Gunnarsson
This commit is contained in:
Hrishikesh Vaipurkar
2025-10-14 09:19:43 +00:00
parent bdc44898d9
commit 36f44d1c0c
3 changed files with 20 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { type NextRequest } from "next/server"
import { type NextRequest, NextResponse } from "next/server"
import { getPublicURL } from "@/server/utils"
@@ -13,5 +13,7 @@ export async function GET(
const publicURL = getPublicURL(request)
const redirectTo: string = publicURL
await signOut({ redirectTo, redirect: true })
await signOut({ redirectTo, redirect: false })
return NextResponse.redirect(redirectTo)
}

View File

@@ -14,7 +14,6 @@ import { useIntl } from "react-intl"
import { Avatar } from "@scandic-hotels/design-system/Avatar"
import { Button } from "@scandic-hotels/design-system/Button"
import { Divider } from "@scandic-hotels/design-system/Divider"
import Link from "@scandic-hotels/design-system/Link"
import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { trpc } from "@scandic-hotels/trpc/client"
@@ -188,13 +187,12 @@ function UserMenuContent({
</p>
</div>
<Divider className={styles.menuDivider} />
<Link
href={`/${lang}/logout`}
prefetch={false}
className={styles.logoutLink}
>
{intl.formatMessage({ defaultMessage: "Logout" })}
</Link>
<Typography variant={"Link/md"} className={styles.logoutLink}>
{/* Link triggers rsc which doesn't reload complete page and shows logged in even after logout */}
<a href={`/${lang}/logout`}>
{intl.formatMessage({ defaultMessage: "Logout" })}
</a>
</Typography>
</>
)
}

View File

@@ -33,10 +33,19 @@
.logoutLink,
.loginLink {
color: var(--Text-sas-20);
font-weight: 400;
text-decoration: none;
}
.userDetailsContainer .logoutLink {
text-decoration: none;
font-weight: normal;
&:hover {
color: var(--Text-sas-20);
text-decoration: none;
}
}
.modal {
position: fixed;
top: calc(var(--main-menu-mobile-height) + var(--sitewide-alert-height));