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
19 lines
519 B
TypeScript
19 lines
519 B
TypeScript
import { type NextRequest, NextResponse } from "next/server"
|
|
|
|
import { getPublicURL } from "@/server/utils"
|
|
|
|
import { signOut } from "@/auth"
|
|
import { destroySocialSession } from "@/auth/scandic/session"
|
|
|
|
export async function GET(request: NextRequest) {
|
|
const publicURL = getPublicURL(request)
|
|
|
|
const redirectTo: string = publicURL
|
|
await signOut({ redirectTo, redirect: false })
|
|
|
|
// Delete scandic session once user logouts from sas
|
|
await destroySocialSession()
|
|
|
|
return NextResponse.redirect(redirectTo)
|
|
}
|