prompt when loginsetting, escape prompt when alt

This commit is contained in:
Max Peintner
2023-07-03 17:05:55 +02:00
parent e529401ff2
commit 54388e4d8f
10 changed files with 122 additions and 57 deletions

View File

@@ -1,14 +1,9 @@
import {
createSession,
getSession,
listAuthenticationMethodTypes,
server,
} from "#/lib/zitadel";
import {
SessionCookie,
addSessionToCookie,
getSessionCookieById,
} from "#/utils/cookies";
import { getSessionCookieById } from "#/utils/cookies";
import { createSessionAndUpdateCookie } from "#/utils/session";
import { NextRequest, NextResponse } from "next/server";

View File

@@ -19,7 +19,14 @@ export async function POST(request: NextRequest) {
const domain: string = request.nextUrl.hostname;
return createSessionAndUpdateCookie(loginName, password, domain, undefined);
return createSessionAndUpdateCookie(
loginName,
password,
domain,
undefined
).then((session) => {
return NextResponse.json(session);
});
} else {
return NextResponse.json(
{ details: "Session could not be created" },