From 64cec2987d5dbbdbac36e5343a21addddeb8dbff Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 1 Jun 2021 16:08:01 +0200 Subject: [PATCH] AccountController: serialize user personal info fields --- src/auth/AccountController.ts | 1 + src/auth/models/User.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/auth/AccountController.ts b/src/auth/AccountController.ts index 802fe43..e99d70a 100644 --- a/src/auth/AccountController.ts +++ b/src/auth/AccountController.ts @@ -58,6 +58,7 @@ export default class AccountController extends Controller { const nameChangeRemainingTime = new Date(nameChangedAt + nameChangeWaitPeriod); res.render('auth/account/account', { + user_personal_info_fields: user.getPersonalInfoFields(), main_email: await user.mainEmail.get(), emails: await user.emails.get(), display_email_warning: config.get('app.display_email_warning'), diff --git a/src/auth/models/User.ts b/src/auth/models/User.ts index 418fafd..ef368d7 100644 --- a/src/auth/models/User.ts +++ b/src/auth/models/User.ts @@ -43,7 +43,7 @@ export default class User extends Model { return !User.isApprovalMode() || this.as(UserApprovedComponent).approved; } - protected getPersonalInfoFields(): { name: string, value: string }[] { + public getPersonalInfoFields(): { name: string, value: string }[] { const fields: { name: string, value: string }[] = []; const nameComponent = this.asOptional(UserNameComponent); if (nameComponent && nameComponent.hasName()) {