UI: Minor fix style and fix signing key validation

This commit is contained in:
Vladyslav_Prykhodko 2022-11-15 11:29:12 +02:00
parent 581af4da0f
commit 4d97b355d3
2 changed files with 5 additions and 1 deletions

View File

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

View File

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