Merged in feat/LOY-230-Microsoft-Entra-ID-Auth (pull request #2113)
Feat(LOY-230): DTMC Routes with Entra ID Auth & Error Page Handling * feat(LOY-230): Link Scandic Friends and Azure accounts * fix(LOY-230): remove employee id param setting * fix(LOY-230): return token in jwt callback for auth.dtmc.ts Approved-by: Michael Zetterberg Approved-by: Christian Andolf
This commit is contained in:
@@ -2,7 +2,7 @@ import React from "react"
|
||||
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { linkEmployment } from "@/constants/routes/dtmc"
|
||||
import { dtmcLogin } from "@/constants/routes/dtmc"
|
||||
import { login } from "@/constants/routes/handleAuth"
|
||||
import { signup } from "@/constants/routes/signup"
|
||||
|
||||
@@ -19,6 +19,8 @@ export default async function EmployeeBenefitsCallToActions() {
|
||||
const intl = await getIntl()
|
||||
const lang = await getLang()
|
||||
|
||||
const loginAndLinkURL = `${login[lang]}?redirectTo=${encodeURIComponent(dtmcLogin[lang])}`
|
||||
|
||||
if (!isValidSession(session)) {
|
||||
return (
|
||||
<>
|
||||
@@ -30,7 +32,7 @@ export default async function EmployeeBenefitsCallToActions() {
|
||||
})}
|
||||
</p>
|
||||
</Typography>
|
||||
<ButtonLink href={login[lang]} size="Medium" variant="Tertiary">
|
||||
<ButtonLink href={loginAndLinkURL} size="Medium" variant="Tertiary">
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Log in and link employment",
|
||||
})}
|
||||
@@ -62,7 +64,7 @@ export default async function EmployeeBenefitsCallToActions() {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<ButtonLink
|
||||
href={linkEmployment[lang]}
|
||||
href={dtmcLogin[lang]}
|
||||
size="Medium"
|
||||
variant="Tertiary"
|
||||
color="Primary"
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import { useRouter, useSearchParams } from "next/navigation"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { DTMC_SUCCESS_BANNER_KEY } from "@/constants/dtmc"
|
||||
|
||||
import Alert from "@/components/TempDesignSystem/Alert"
|
||||
|
||||
import { AlertTypeEnum } from "@/types/enums/alert"
|
||||
@@ -14,11 +16,11 @@ export default function DigitalTeamMemberCardAlert() {
|
||||
|
||||
function removeSearchParam() {
|
||||
const params = new URLSearchParams(searchParams)
|
||||
params.delete("card_added")
|
||||
params.delete(DTMC_SUCCESS_BANNER_KEY)
|
||||
router.replace(`${window.location.pathname}?${params.toString()}`)
|
||||
}
|
||||
|
||||
if (searchParams.get("card_added") !== "true") {
|
||||
if (searchParams.get(DTMC_SUCCESS_BANNER_KEY) !== "true") {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user