Skip to content

Commit fbe35e1

Browse files
authored
Merge pull request DSpace#1863 from 4Science/CST-6932
Registration page password validation
2 parents 695ce3a + a011c30 commit fbe35e1

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/app/register-page/create-profile/create-profile.component.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ export class CreateProfileComponent implements OnInit {
4141
userInfoForm: FormGroup;
4242
activeLangs: LangConfig[];
4343

44+
/**
45+
* Prefix for the notification messages of this security form
46+
*/
47+
NOTIFICATIONS_PREFIX = 'register-page.create-profile.submit.';
48+
4449
constructor(
4550
private translateService: TranslateService,
4651
private ePersonDataService: EPersonDataService,
@@ -161,13 +166,12 @@ export class CreateProfileComponent implements OnInit {
161166
getFirstCompletedRemoteData(),
162167
).subscribe((rd: RemoteData<EPerson>) => {
163168
if (rd.hasSucceeded) {
164-
this.notificationsService.success(this.translateService.get('register-page.create-profile.submit.success.head'),
165-
this.translateService.get('register-page.create-profile.submit.success.content'));
169+
this.notificationsService.success(this.translateService.get(this.NOTIFICATIONS_PREFIX + 'success.head'),
170+
this.translateService.get(this.NOTIFICATIONS_PREFIX + 'success.content'));
166171
this.store.dispatch(new AuthenticateAction(this.email, this.password));
167172
this.router.navigate(['/home']);
168173
} else {
169-
this.notificationsService.error(this.translateService.get('register-page.create-profile.submit.error.head'),
170-
this.translateService.get('register-page.create-profile.submit.error.content'));
174+
this.notificationsService.error(this.translateService.get(this.NOTIFICATIONS_PREFIX + 'error.head'), rd.errorMessage);
171175
}
172176
});
173177
}

0 commit comments

Comments
 (0)