mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-11 22:42:18 +00:00
cleaner override
This commit is contained in:
@@ -28,7 +28,10 @@ import {
|
|||||||
} from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
|
} from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
|
||||||
import { PasswordComplexitySettingsSchema } from "@zitadel/proto/zitadel/settings/v2/password_settings_pb";
|
import { PasswordComplexitySettingsSchema } from "@zitadel/proto/zitadel/settings/v2/password_settings_pb";
|
||||||
import type { RedirectURLsJson } from "@zitadel/proto/zitadel/user/v2/idp_pb";
|
import type { RedirectURLsJson } from "@zitadel/proto/zitadel/user/v2/idp_pb";
|
||||||
import { NotificationType } from "@zitadel/proto/zitadel/user/v2/password_pb";
|
import {
|
||||||
|
NotificationType,
|
||||||
|
SendPasswordResetLink,
|
||||||
|
} from "@zitadel/proto/zitadel/user/v2/password_pb";
|
||||||
import {
|
import {
|
||||||
SearchQuery,
|
SearchQuery,
|
||||||
SearchQuerySchema,
|
SearchQuerySchema,
|
||||||
@@ -493,22 +496,23 @@ export function createUser(
|
|||||||
* @returns the newly set email
|
* @returns the newly set email
|
||||||
*/
|
*/
|
||||||
export async function passwordReset(userId: string, host: string | null) {
|
export async function passwordReset(userId: string, host: string | null) {
|
||||||
|
let medium: Partial<SendPasswordResetLink> = {
|
||||||
|
notificationType: NotificationType.Email,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (host) {
|
||||||
|
medium = {
|
||||||
|
...medium,
|
||||||
|
urlTemplate: `https://${host}/password/set?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return userService.passwordReset(
|
return userService.passwordReset(
|
||||||
{
|
{
|
||||||
userId,
|
userId,
|
||||||
medium: host
|
medium: {
|
||||||
? {
|
|
||||||
case: "sendLink",
|
case: "sendLink",
|
||||||
value: {
|
value: medium,
|
||||||
notificationType: NotificationType.Email,
|
|
||||||
urlTemplate: `https://${host}/password/set?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}`,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
case: "sendLink",
|
|
||||||
value: {
|
|
||||||
notificationType: NotificationType.Email,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
|
|||||||
Reference in New Issue
Block a user