mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 19:32:15 +00:00
org filter
This commit is contained in:
@@ -8,9 +8,10 @@ export default async function Page({
|
||||
}) {
|
||||
const loginName = searchParams?.loginName;
|
||||
const authRequestId = searchParams?.authRequestId;
|
||||
const organization = searchParams?.organization;
|
||||
const submit: boolean = searchParams?.submit === "true";
|
||||
|
||||
const loginSettings = await getLoginSettings(server);
|
||||
const loginSettings = await getLoginSettings(server, organization);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center space-y-4">
|
||||
@@ -21,6 +22,7 @@ export default async function Page({
|
||||
loginSettings={loginSettings}
|
||||
loginName={loginName}
|
||||
authRequestId={authRequestId}
|
||||
organization={organization}
|
||||
submit={submit}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { listAuthenticationMethodTypes } from "#/lib/zitadel";
|
||||
import { listAuthenticationMethodTypes, listUsers } from "#/lib/zitadel";
|
||||
import { createSessionAndUpdateCookie } from "#/utils/session";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
const body = await request.json();
|
||||
if (body) {
|
||||
const { loginName, authRequestId } = body;
|
||||
|
||||
const { loginName, authRequestId, organization } = body;
|
||||
// TODO - search for users with org
|
||||
// return listUsers(loginName).then((users) => {
|
||||
// if (users.details && users.details.totalResult == 1) {
|
||||
// }
|
||||
return createSessionAndUpdateCookie(
|
||||
loginName,
|
||||
undefined,
|
||||
@@ -33,6 +36,7 @@ export async function POST(request: NextRequest) {
|
||||
.catch((error) => {
|
||||
return NextResponse.json(error, { status: 500 });
|
||||
});
|
||||
// });
|
||||
} else {
|
||||
return NextResponse.error();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user