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" import { getPublicURL } from "@/server/utils"
@@ -13,5 +13,7 @@ export async function GET(
const publicURL = getPublicURL(request) const publicURL = getPublicURL(request)
const redirectTo: string = publicURL 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 { Avatar } from "@scandic-hotels/design-system/Avatar"
import { Button } from "@scandic-hotels/design-system/Button" import { Button } from "@scandic-hotels/design-system/Button"
import { Divider } from "@scandic-hotels/design-system/Divider" 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 SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer"
import { Typography } from "@scandic-hotels/design-system/Typography" import { Typography } from "@scandic-hotels/design-system/Typography"
import { trpc } from "@scandic-hotels/trpc/client" import { trpc } from "@scandic-hotels/trpc/client"
@@ -188,13 +187,12 @@ function UserMenuContent({
</p> </p>
</div> </div>
<Divider className={styles.menuDivider} /> <Divider className={styles.menuDivider} />
<Link <Typography variant={"Link/md"} className={styles.logoutLink}>
href={`/${lang}/logout`} {/* Link triggers rsc which doesn't reload complete page and shows logged in even after logout */}
prefetch={false} <a href={`/${lang}/logout`}>
className={styles.logoutLink} {intl.formatMessage({ defaultMessage: "Logout" })}
> </a>
{intl.formatMessage({ defaultMessage: "Logout" })} </Typography>
</Link>
</> </>
) )
} }

View File

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