Merged in chore/upgrade-next (pull request #3124)
Upgrade next@15.5.6 * chore: upgrade next@15.5.6 * chore: upgrade turborepo@2.6.1 * fix typings for scandic-web * fix: set correct type for pages * cleanup * fix more route.ts typing issues * Merge branch 'master' of bitbucket.org:scandic-swap/web into chore/upgrade-next * explicitly import the types Approved-by: Linus Flood
This commit is contained in:
@@ -12,10 +12,11 @@ import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
context: { params: Promise<{ lang: Lang }> }
|
||||
context: RouteContext<"/[lang]/login">
|
||||
) {
|
||||
const contextParams = await context.params
|
||||
const params = await context.params
|
||||
const publicURL = getPublicURL(request)
|
||||
const lang = params.lang as Lang
|
||||
|
||||
let redirectHeaders: Headers | undefined = undefined
|
||||
let redirectTo: string
|
||||
@@ -61,7 +62,7 @@ export async function GET(
|
||||
|
||||
/** Record<string, any> is next-auth typings */
|
||||
const params = {
|
||||
ui_locales: SAS_LANGUAGE_MAP[contextParams.lang],
|
||||
ui_locales: SAS_LANGUAGE_MAP[lang],
|
||||
scope: ["openid", "profile", "email", "offline_access"].join(" "),
|
||||
} satisfies Record<string, string>
|
||||
|
||||
|
||||
@@ -5,12 +5,7 @@ import { getPublicURL } from "@/server/utils"
|
||||
import { signOut } from "@/auth"
|
||||
import { destroySocialSession } from "@/auth/scandic/session"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
_context: { params: Promise<{ lang: Lang }> }
|
||||
) {
|
||||
export async function GET(request: NextRequest) {
|
||||
const publicURL = getPublicURL(request)
|
||||
|
||||
const redirectTo: string = publicURL
|
||||
|
||||
@@ -29,19 +29,9 @@ import { Footer } from "../../components/Footer/Footer"
|
||||
import { Header } from "../../components/Header/Header"
|
||||
import { SocialLoginProvider } from "./(auth)/SocialLogin"
|
||||
|
||||
type LangParams = {
|
||||
lang: Lang
|
||||
}
|
||||
|
||||
type RootLayoutProps = {
|
||||
children: React.ReactNode
|
||||
params: Promise<LangParams>
|
||||
bookingwidget: React.ReactNode
|
||||
}
|
||||
|
||||
export default async function RootLayout(props: RootLayoutProps) {
|
||||
export default async function RootLayout(props: LayoutProps<"/[lang]">) {
|
||||
const params = await props.params
|
||||
const lang = params.lang
|
||||
const lang = params.lang as Lang
|
||||
|
||||
const { children } = props
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import styles from "./page.module.css"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
|
||||
export default async function MiddlewareError(props: {
|
||||
params: Promise<{ lang: Lang; status: string }>
|
||||
}) {
|
||||
export default async function MiddlewareError(
|
||||
props: PageProps<"/[lang]/middleware-error/[status]">
|
||||
) {
|
||||
const params = await props.params
|
||||
|
||||
return (
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"@tanstack/react-query": "^5.75.5",
|
||||
"@tanstack/react-query-devtools": "^5.75.5",
|
||||
"iron-session": "^8.0.4",
|
||||
"next": "15.3.4",
|
||||
"next": "^15.5.6",
|
||||
"next-auth": "5.0.0-beta.29",
|
||||
"react": "^19.0.0",
|
||||
"react-aria-components": "^1.8.0",
|
||||
|
||||
Reference in New Issue
Block a user