Fondation
This commit is contained in:
parent
c93a88daf5
commit
8ad048204e
@ -104,8 +104,7 @@ async function ensureUserExists(session: any): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function POST(request: Request) {
|
export async function POST(request: Request) {
|
||||||
try {
|
// Authenticate user (declare outside try to access in catch)
|
||||||
// Authenticate user
|
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
if (!session?.user?.id) {
|
if (!session?.user?.id) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
@ -114,6 +113,8 @@ export async function POST(request: Request) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
// Ensure user exists in database (create if missing)
|
// Ensure user exists in database (create if missing)
|
||||||
// This handles cases where the database was reset but users still exist in Keycloak
|
// This handles cases where the database was reset but users still exist in Keycloak
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user