mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 14:54:33 +00:00
use origin header instead of host
This commit is contained in:
@@ -267,15 +267,15 @@ export async function resendInviteCode(userId: string) {
|
||||
return userService.resendInviteCode({ userId }, {});
|
||||
}
|
||||
|
||||
export async function createInviteCode(userId: string, host: string | null) {
|
||||
export async function createInviteCode(userId: string, origin: string | null) {
|
||||
let medium = create(SendInviteCodeSchema, {
|
||||
applicationName: "Typescript Login",
|
||||
});
|
||||
|
||||
if (host) {
|
||||
if (origin) {
|
||||
medium = {
|
||||
...medium,
|
||||
urlTemplate: `${host.includes("localhost") ? "http://" : "https://"}${host}/verify?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}&invite=true`,
|
||||
urlTemplate: `${origin}/verify?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}&invite=true`,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -506,18 +506,18 @@ export function createUser(
|
||||
*/
|
||||
export async function passwordReset(
|
||||
userId: string,
|
||||
host: string | null,
|
||||
origin: string | null,
|
||||
authRequestId?: string,
|
||||
) {
|
||||
let medium = create(SendPasswordResetLinkSchema, {
|
||||
notificationType: NotificationType.Email,
|
||||
});
|
||||
|
||||
if (host) {
|
||||
if (origin) {
|
||||
medium = {
|
||||
...medium,
|
||||
urlTemplate:
|
||||
`${host.includes("localhost") ? "http://" : "https://"}${host}/password/set?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}` +
|
||||
`${origin}/password/set?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}` +
|
||||
(authRequestId ? `&authRequestId=${authRequestId}` : ""),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user