Browse Source

UI: Minor fix style and fix signing key validation

pull/7297/head
Vladyslav_Prykhodko 4 years ago
parent
commit
4d97b355d3
  1. 1
      ui-ngx/src/app/modules/home/pages/admin/security-settings.component.html
  2. 5
      ui-ngx/src/app/modules/home/pages/admin/security-settings.component.ts

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

@ -180,6 +180,7 @@
<mat-label translate>admin.jwt.signings-key</mat-label>
<input matInput (focus)="markAsTouched()" required formControlName="tokenSigningKey"/>
<button type="button"
style="line-height: 32px"
matSuffix
mat-button
(click)="generateSigningKey()"

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

@ -172,9 +172,12 @@ export class SecuritySettingsComponent extends PageComponent implements HasConfi
}
private base64Format(control: FormControl): { [key: string]: boolean } | null {
if (control.value === '' || control.value === 'thingsboardDefaultSigningKey') {
return null;
}
try {
const value = atob(control.value);
if (value.length < 32 && control.value !== 'thingsboardDefaultSigningKey') {
if (value.length < 32) {
return {minLength: true};
}
return null;

Loading…
Cancel
Save