fix(backup): harden portal credential restore

This commit is contained in:
4gray committed 2026-07-27 12:06:56 +02:00
1 parent 9988e506de
commit 171095e091
9 files changed
+332 -24

No files matched your search

@@ -96,7 +96,7 @@ describe('SettingsBackupCredentialsDialogComponent', () => {
expect(text).toContain('Enter a password.');
});
it('returns a trimmed username while preserving the password exactly', () => {
it('returns the username and password exactly as entered', () => {
component.credentialsForm.setValue({
username: ' viewer ',
password: ' secret with spaces ',
@@ -105,7 +105,7 @@ describe('SettingsBackupCredentialsDialogComponent', () => {
component.submit();
expect(dialogRef.close).toHaveBeenCalledWith({
username: 'viewer',
username: ' viewer ',
password: ' secret with spaces ',
});
});
@@ -59,7 +59,7 @@ export class SettingsBackupCredentialsDialogComponent {
const { username, password } = this.credentialsForm.getRawValue();
this.dialogRef.close({
username: username.trim(),
username,
password,
});
}