Browse Source

UI for password reset and user activation links TTL (Security settings)

pull/11578/head
ViacheslavKlimov 2 years ago
parent
commit
567986cb40
  1. 38
      ui-ngx/src/app/modules/home/pages/admin/security-settings.component.html
  2. 3
      ui-ngx/src/app/modules/home/pages/admin/security-settings.component.ts
  3. 5
      ui-ngx/src/app/shared/models/settings.models.ts
  4. 6
      ui-ngx/src/assets/locale/locale.constant-en_US.json

38
ui-ngx/src/app/modules/home/pages/admin/security-settings.component.html

@ -46,6 +46,44 @@
<input matInput type="email"
formControlName="userLockoutNotificationEmail"/>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-label translate>admin.user-activation-token-ttl</mat-label>
<input matInput type="number"
formControlName="userActivationTokenTtl"
step="1"
min="1"
max="24"/>
<mat-error *ngIf="securitySettingsFormGroup.get('userActivationTokenTtl').hasError('min')">
{{ 'admin.user-activation-token-ttl-range' | translate }}
</mat-error>
<mat-error *ngIf="securitySettingsFormGroup.get('userActivationTokenTtl').hasError('max')">
{{ 'admin.user-activation-token-ttl-range' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-label translate>admin.password-reset-token-ttl</mat-label>
<input matInput type="number"
formControlName="passwordResetTokenTtl"
step="1"
min="1"
max="24"/>
<mat-error *ngIf="securitySettingsFormGroup.get('passwordResetTokenTtl').hasError('min')">
{{ 'admin.password-reset-token-ttl-range' | translate }}
</mat-error>
<mat-error *ngIf="securitySettingsFormGroup.get('passwordResetTokenTtl').hasError('max')">
{{ 'admin.password-reset-token-ttl-range' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-label translate>admin.mobile-secret-key-length</mat-label>
<input matInput type="number"
formControlName="mobileSecretKeyLength"
step="1"
min="1"/>
<mat-error *ngIf="securitySettingsFormGroup.get('mobileSecretKeyLength').hasError('min')">
{{ 'admin.mobile-secret-key-length-range' | translate }}
</mat-error>
</mat-form-field>
</fieldset>
<fieldset class="fields-group">

3
ui-ngx/src/app/modules/home/pages/admin/security-settings.component.ts

@ -75,6 +75,9 @@ export class SecuritySettingsComponent extends PageComponent implements HasConfi
this.securitySettingsFormGroup = this.fb.group({
maxFailedLoginAttempts: [null, [Validators.min(0)]],
userLockoutNotificationEmail: ['', []],
userActivationTokenTtl: [24, [Validators.required, Validators.min(1), Validators.max(24)]],
passwordResetTokenTtl: [24, [Validators.required, Validators.min(1), Validators.max(24)]],
mobileSecretKeyLength: [null, [Validators.min(1)]],
passwordPolicy: this.fb.group(
{
minimumLength: [null, [Validators.required, Validators.min(6), Validators.max(50)]],

5
ui-ngx/src/app/shared/models/settings.models.ts

@ -111,6 +111,11 @@ export interface UserPasswordPolicy {
export interface SecuritySettings {
passwordPolicy: UserPasswordPolicy;
maxFailedLoginAttempts: number;
userLockoutNotificationEmail: string;
mobileSecretKeyLength: number;
userActivationTokenTtl: number;
passwordResetTokenTtl: number;
}
export interface JwtSettings {

6
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -205,6 +205,12 @@
"max-failed-login-attempts": "Maximum number of failed login attempts, before account is locked",
"minimum-max-failed-login-attempts-range": "Maximum number of failed login attempts can't be negative",
"user-lockout-notification-email": "In case user account lockout, send notification to email",
"user-activation-token-ttl": "User activation link TTL in hours",
"user-activation-token-ttl-range": "User activation link TTL must be in range from 1 to 24 hours",
"password-reset-token-ttl": "Password reset link TTL in hours",
"password-reset-token-ttl-range": "Password reset link TTL must be in range from 1 to 24 hours",
"mobile-secret-key-length": "Mobile secret key length",
"mobile-secret-key-length-range": "Mobile secret key length must be positive",
"domain-name": "Domain name",
"domain-name-unique": "Domain name and protocol need to unique.",
"domain-name-max-length": "Domain name should be less than 256",

Loading…
Cancel
Save