import {NextResponse} from 'next/server'

export async function POST() {
    const keycloakLogoutUrl = process.env.KEYCLOAK_LOGOUT_URL

    if (!keycloakLogoutUrl) {
        return new NextResponse('Missing KEYCLOAK_LOGOUT_URL env variable', {status: 500})
    }

    return NextResponse.redirect(keycloakLogoutUrl, 302)
}
