mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 06:52:24 +00:00
cleanup
This commit is contained in:
@@ -6,17 +6,7 @@ export async function POST(request: NextRequest) {
|
|||||||
const body = await request.json();
|
const body = await request.json();
|
||||||
if (body) {
|
if (body) {
|
||||||
const { loginName, authRequestId, organization } = body;
|
const { loginName, authRequestId, organization } = body;
|
||||||
// TODO - search for users with org
|
|
||||||
console.log(
|
|
||||||
"loginName",
|
|
||||||
loginName,
|
|
||||||
"authRequestId",
|
|
||||||
authRequestId,
|
|
||||||
"organization",
|
|
||||||
organization
|
|
||||||
);
|
|
||||||
return listUsers(loginName, organization).then((users) => {
|
return listUsers(loginName, organization).then((users) => {
|
||||||
console.log("users", users);
|
|
||||||
if (
|
if (
|
||||||
users.details &&
|
users.details &&
|
||||||
users.details.totalResult == 1 &&
|
users.details.totalResult == 1 &&
|
||||||
@@ -30,7 +20,6 @@ export async function POST(request: NextRequest) {
|
|||||||
authRequestId
|
authRequestId
|
||||||
)
|
)
|
||||||
.then((session) => {
|
.then((session) => {
|
||||||
console.log(session);
|
|
||||||
if (session.factors?.user?.id) {
|
if (session.factors?.user?.id) {
|
||||||
return listAuthenticationMethodTypes(session.factors?.user?.id)
|
return listAuthenticationMethodTypes(session.factors?.user?.id)
|
||||||
.then((methods) => {
|
.then((methods) => {
|
||||||
@@ -48,6 +37,7 @@ export async function POST(request: NextRequest) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
console.error(error);
|
||||||
return NextResponse.json(error, { status: 500 });
|
return NextResponse.json(error, { status: 500 });
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user