UI: Minor fix style and fix signing key validation
This commit is contained in:
parent
581af4da0f
commit
4d97b355d3
@ -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()"
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user