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:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user