Merged in fix/use-image-component-for-dtmc-link-error (pull request #2515)
Use component image for dtmc error page bg * Use component image for dtmc error page bg Approved-by: Joakim Jäderberg Approved-by: Anton Gunnarsson Approved-by: Matilda Landström
This commit is contained in:
@@ -1,20 +1,21 @@
|
|||||||
import { NextResponse } from "next/server"
|
import { type NextRequest, NextResponse } from "next/server"
|
||||||
import { AuthError } from "next-auth"
|
import { AuthError } from "next-auth"
|
||||||
|
|
||||||
import { logger } from "@scandic-hotels/common/logger"
|
import { logger } from "@scandic-hotels/common/logger"
|
||||||
|
|
||||||
import { dtmcApiCallback } from "@/constants/routes/dtmc"
|
import { dtmcApiCallback } from "@/constants/routes/dtmc"
|
||||||
import { env } from "@/env/server"
|
|
||||||
import { internalServerError, serviceUnavailable } from "@/server/errors/next"
|
import { internalServerError, serviceUnavailable } from "@/server/errors/next"
|
||||||
|
import { getPublicURL } from "@/server/utils"
|
||||||
|
|
||||||
import { signIn } from "@/auth.dtmc"
|
import { signIn } from "@/auth.dtmc"
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET(request: NextRequest) {
|
||||||
|
const publicURL = getPublicURL(request)
|
||||||
try {
|
try {
|
||||||
const redirectUrl = await signIn(
|
const redirectUrl = await signIn(
|
||||||
"microsoft-entra-id",
|
"microsoft-entra-id",
|
||||||
{
|
{
|
||||||
redirectTo: `${env.PUBLIC_URL}${dtmcApiCallback}`,
|
redirectTo: `${publicURL}${dtmcApiCallback}`,
|
||||||
redirect: false,
|
redirect: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import Image from "next/image"
|
|
||||||
import { useSearchParams } from "next/navigation"
|
import { useSearchParams } from "next/navigation"
|
||||||
import { type IntlShape, useIntl } from "react-intl"
|
import { type IntlShape, useIntl } from "react-intl"
|
||||||
|
|
||||||
@@ -12,6 +11,7 @@ import { supportEmail, supportPhone } from "@/constants/contactSupport"
|
|||||||
import { employeeBenefits } from "@/constants/routes/dtmc"
|
import { employeeBenefits } from "@/constants/routes/dtmc"
|
||||||
|
|
||||||
import ButtonLink from "@/components/ButtonLink"
|
import ButtonLink from "@/components/ButtonLink"
|
||||||
|
import Image from "@/components/Image"
|
||||||
import Link from "@/components/TempDesignSystem/Link"
|
import Link from "@/components/TempDesignSystem/Link"
|
||||||
import useLang from "@/hooks/useLang"
|
import useLang from "@/hooks/useLang"
|
||||||
import background from "@/public/_static/img/Scandic_Computer_Coffee.png"
|
import background from "@/public/_static/img/Scandic_Computer_Coffee.png"
|
||||||
|
|||||||
Reference in New Issue
Block a user