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) {
|
export async function sendLoginname(command: SendLoginnameCommand) {
|
||||||
const users = await listUsers({
|
const users = await listUsers({
|
||||||
userName: command.loginName,
|
loginName: command.loginName,
|
||||||
organizationId: command.organization,
|
organizationId: command.organization,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ type ResetPasswordCommand = {
|
|||||||
|
|
||||||
export async function resetPassword(command: ResetPasswordCommand) {
|
export async function resetPassword(command: ResetPasswordCommand) {
|
||||||
const users = await listUsers({
|
const users = await listUsers({
|
||||||
userName: command.loginName,
|
loginName: command.loginName,
|
||||||
organizationId: command.organization,
|
organizationId: command.organization,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -258,23 +258,39 @@ export async function getUserByID(userId: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function listUsers({
|
export async function listUsers({
|
||||||
|
loginName,
|
||||||
userName,
|
userName,
|
||||||
email,
|
email,
|
||||||
organizationId,
|
organizationId,
|
||||||
}: {
|
}: {
|
||||||
|
loginName?: string;
|
||||||
userName?: string;
|
userName?: string;
|
||||||
email?: string;
|
email?: string;
|
||||||
organizationId?: string;
|
organizationId?: string;
|
||||||
}) {
|
}) {
|
||||||
const queries: SearchQuery[] = [];
|
const queries: SearchQuery[] = [];
|
||||||
|
|
||||||
|
if (loginName) {
|
||||||
|
queries.push(
|
||||||
|
create(SearchQuerySchema, {
|
||||||
|
query: {
|
||||||
|
case: "loginNameQuery",
|
||||||
|
value: {
|
||||||
|
loginName: loginName,
|
||||||
|
method: TextQueryMethod.EQUALS,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (userName) {
|
if (userName) {
|
||||||
queries.push(
|
queries.push(
|
||||||
create(SearchQuerySchema, {
|
create(SearchQuerySchema, {
|
||||||
query: {
|
query: {
|
||||||
case: "userNameQuery",
|
case: "userNameQuery",
|
||||||
value: {
|
value: {
|
||||||
userName,
|
userName: userName,
|
||||||
method: TextQueryMethod.EQUALS,
|
method: TextQueryMethod.EQUALS,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user