mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-15 13:46:16 -08:00
fix(backup): harden portal credential restore
This commit is contained in:
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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user