Merged in feat/SW-3552-logout-from-social-session-when- (pull request #2994)
feat(SW-3552): Removed scandic session on logout Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -3,6 +3,7 @@ import { type NextRequest, NextResponse } from "next/server"
|
||||
import { getPublicURL } from "@/server/utils"
|
||||
|
||||
import { signOut } from "@/auth"
|
||||
import { destroySession } from "@/auth/scandic/session"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
|
||||
@@ -15,5 +16,8 @@ export async function GET(
|
||||
const redirectTo: string = publicURL
|
||||
await signOut({ redirectTo, redirect: false })
|
||||
|
||||
// Delete scandic session once user logouts from sas
|
||||
await destroySession()
|
||||
|
||||
return NextResponse.redirect(redirectTo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user