@punks/backend-entity-manager 0.0.146 → 0.0.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +11 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/email.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/appAuth/appAuth.dto.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/extensions/authentication/handlers/user-password-reset-request/types.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/extensions/authentication/handlers/user-register/types.d.ts +1 -1
- package/dist/esm/index.js +11 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/email.d.ts +1 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/appAuth/appAuth.dto.d.ts +1 -1
- package/dist/esm/types/platforms/nest/extensions/authentication/handlers/user-password-reset-request/types.d.ts +1 -1
- package/dist/esm/types/platforms/nest/extensions/authentication/handlers/user-register/types.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -20525,7 +20525,7 @@ let UserRegistrationHandler = class UserRegistrationHandler {
|
|
|
20525
20525
|
passwordHash,
|
|
20526
20526
|
passwordUpdateTimestamp: new Date(),
|
|
20527
20527
|
});
|
|
20528
|
-
await this.sendRegistrationEmail(user, input.callback, input.
|
|
20528
|
+
await this.sendRegistrationEmail(user, input.callback, input.languageCode);
|
|
20529
20529
|
this.logger.debug(`User already exists but not verified. Sending new verification email: ${input.email} - ${input.userName}`, { user });
|
|
20530
20530
|
return {
|
|
20531
20531
|
success: true,
|
|
@@ -20538,7 +20538,7 @@ let UserRegistrationHandler = class UserRegistrationHandler {
|
|
|
20538
20538
|
passwordHash,
|
|
20539
20539
|
passwordUpdateTimestamp: new Date(),
|
|
20540
20540
|
});
|
|
20541
|
-
await this.sendRegistrationEmail(newUser, input.callback, input.
|
|
20541
|
+
await this.sendRegistrationEmail(newUser, input.callback, input.languageCode);
|
|
20542
20542
|
this.logger.debug(`New user created: ${input.email} - ${input.userName}`, {
|
|
20543
20543
|
user: newUser,
|
|
20544
20544
|
});
|
|
@@ -20558,7 +20558,7 @@ let UserRegistrationHandler = class UserRegistrationHandler {
|
|
|
20558
20558
|
await this.emailService.sendTemplatedEmail({
|
|
20559
20559
|
to: [user.email],
|
|
20560
20560
|
templateId: AuthenticationEmailTemplates.Registration,
|
|
20561
|
-
languageId,
|
|
20561
|
+
languageCode: languageId,
|
|
20562
20562
|
payload: {
|
|
20563
20563
|
firstName: user.profile.firstName,
|
|
20564
20564
|
lastName: user.profile.lastName,
|
|
@@ -20761,17 +20761,17 @@ let UserPasswordResetRequestHandler = class UserPasswordResetRequestHandler {
|
|
|
20761
20761
|
success: false,
|
|
20762
20762
|
};
|
|
20763
20763
|
}
|
|
20764
|
-
await this.sendPasswordResetEmail(user, input.callback, input.
|
|
20764
|
+
await this.sendPasswordResetEmail(user, input.callback, input.languageCode);
|
|
20765
20765
|
return {
|
|
20766
20766
|
success: true,
|
|
20767
20767
|
};
|
|
20768
20768
|
}
|
|
20769
|
-
async sendPasswordResetEmail(user, callback,
|
|
20769
|
+
async sendPasswordResetEmail(user, callback, languageCode) {
|
|
20770
20770
|
const token = await this.generatePasswordResetToken(user);
|
|
20771
20771
|
await this.emailService.sendTemplatedEmail({
|
|
20772
20772
|
to: [user.email],
|
|
20773
20773
|
templateId: AuthenticationEmailTemplates.PasswordReset,
|
|
20774
|
-
|
|
20774
|
+
languageCode,
|
|
20775
20775
|
payload: {
|
|
20776
20776
|
firstName: user.profile.firstName,
|
|
20777
20777
|
lastName: user.profile.lastName,
|
|
@@ -20886,7 +20886,7 @@ let UserVerifyRequestHandler = class UserVerifyRequestHandler {
|
|
|
20886
20886
|
lastName: user.profile.lastName,
|
|
20887
20887
|
callbackUrl: callback.urlTemplate.replace(callback.tokenPlaceholder, token),
|
|
20888
20888
|
},
|
|
20889
|
-
languageId,
|
|
20889
|
+
languageCode: languageId,
|
|
20890
20890
|
});
|
|
20891
20891
|
}
|
|
20892
20892
|
async generateEmailVerifyToken(user) {
|
|
@@ -28037,13 +28037,13 @@ let SendgridEmailProvider = class SendgridEmailProvider {
|
|
|
28037
28037
|
const processedPayload = await template.processPayload(input.payload);
|
|
28038
28038
|
const templateData = await template.getTemplateData(processedPayload);
|
|
28039
28039
|
if (templateData.type === "html") {
|
|
28040
|
-
const body = getLocalizedText(templateData.bodyTemplate, input.
|
|
28040
|
+
const body = getLocalizedText(templateData.bodyTemplate, input.languageCode);
|
|
28041
28041
|
if (!body) {
|
|
28042
|
-
throw new Error(`Missing body template for language ${input.
|
|
28042
|
+
throw new Error(`Missing body template for language ${input.languageCode}`);
|
|
28043
28043
|
}
|
|
28044
|
-
const subject = getLocalizedText(templateData.subjectTemplate, input.
|
|
28044
|
+
const subject = getLocalizedText(templateData.subjectTemplate, input.languageCode);
|
|
28045
28045
|
if (!subject) {
|
|
28046
|
-
throw new Error(`Missing subject template for language ${input.
|
|
28046
|
+
throw new Error(`Missing subject template for language ${input.languageCode}`);
|
|
28047
28047
|
}
|
|
28048
28048
|
await this.sendHtmlEmail({
|
|
28049
28049
|
bodyTemplate: body,
|