20 lines
494 B
TypeScript
20 lines
494 B
TypeScript
import { type NextRequest, NextResponse } from "next/server"
|
|
|
|
import { getPublicURL } from "@/server/utils"
|
|
|
|
import { signOut } from "@/auth"
|
|
|
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
|
|
|
export async function GET(
|
|
request: NextRequest,
|
|
_context: { params: Promise<{ lang: Lang }> }
|
|
) {
|
|
const publicURL = getPublicURL(request)
|
|
|
|
const redirectTo: string = publicURL
|
|
await signOut({ redirectTo, redirect: false })
|
|
|
|
return NextResponse.redirect(redirectTo)
|
|
}
|