mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 09:54:00 +00:00
listusers with loginname
This commit is contained in:
@@ -20,7 +20,7 @@ export type SendLoginnameCommand = {
|
||||
|
||||
export async function sendLoginname(command: SendLoginnameCommand) {
|
||||
const users = await listUsers({
|
||||
userName: command.loginName,
|
||||
loginName: command.loginName,
|
||||
organizationId: command.organization,
|
||||
});
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ type ResetPasswordCommand = {
|
||||
|
||||
export async function resetPassword(command: ResetPasswordCommand) {
|
||||
const users = await listUsers({
|
||||
userName: command.loginName,
|
||||
loginName: command.loginName,
|
||||
organizationId: command.organization,
|
||||
});
|
||||
|
||||
|
||||
@@ -258,23 +258,39 @@ export async function getUserByID(userId: string) {
|
||||
}
|
||||
|
||||
export async function listUsers({
|
||||
loginName,
|
||||
userName,
|
||||
email,
|
||||
organizationId,
|
||||
}: {
|
||||
loginName?: string;
|
||||
userName?: string;
|
||||
email?: string;
|
||||
organizationId?: string;
|
||||
}) {
|
||||
const queries: SearchQuery[] = [];
|
||||
|
||||
if (loginName) {
|
||||
queries.push(
|
||||
create(SearchQuerySchema, {
|
||||
query: {
|
||||
case: "loginNameQuery",
|
||||
value: {
|
||||
loginName: loginName,
|
||||
method: TextQueryMethod.EQUALS,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (userName) {
|
||||
queries.push(
|
||||
create(SearchQuerySchema, {
|
||||
query: {
|
||||
case: "userNameQuery",
|
||||
value: {
|
||||
userName,
|
||||
userName: userName,
|
||||
method: TextQueryMethod.EQUALS,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user