1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-23 13:46:45 +02:00

refactor: lax newUserInviteLink user arg (#9967)

Part of:
https://linear.app/unleash/issue/2-3560/payg-flow-sends-2-email-one-from-bluebird-and-one-from-unleash-we-want

This laxes our `user` argument in `newUserInviteLink` to just pick the
id, since that's the only property we're interested in. This allows us
to send `{ id }` when we don't have the full `IUserWithRootRole`
available while keeping compatibility intact.
This commit is contained in:
Nuno Góis 2025-05-13 09:41:33 +01:00 committed by GitHub
parent 9c05e56c4a
commit 333f1203dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -295,7 +295,7 @@ class UserService {
}
async newUserInviteLink(
user: IUserWithRootRole,
{ id: userId }: Pick<IUserWithRootRole, 'id'>,
auditUser: IAuditUser = SYSTEM_USER_AUDIT,
): Promise<string> {
const passwordAuthSettings =
@ -307,7 +307,7 @@ class UserService {
let inviteLink = this.unleashUrl;
if (!passwordAuthSettings.disabled) {
const inviteUrl = await this.resetTokenService.createNewUserUrl(
user.id,
userId,
auditUser.username,
);
inviteLink = inviteUrl.toString();