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>
|
||||
<input matInput (focus)="markAsTouched()" required formControlName="tokenSigningKey"/>
|
||||
<button type="button"
|
||||
style="line-height: 32px"
|
||||
matSuffix
|
||||
mat-button
|
||||
(click)="generateSigningKey()"
|
||||
|
||||
@ -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…
x
Reference in New Issue
Block a user