Skip to content

Commit 2c19ece

Browse files
xflordJohaney-s
authored andcommitted
fix: do not call checkPasswordStrength without authorization unless explicitly needed
* checkPasswordStrength in the password form component is no longer always called with 'non' * this was an issue on certain instances that do not use an API calls only domain
1 parent 16b73ab commit 2c19ece

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

apps/password-reset/src/app/components/password-reset-form/password-reset-form.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ export class PasswordResetFormComponent implements OnInit {
5757
passwordCtrl: [
5858
'',
5959
Validators.required,
60-
[loginAsyncValidator(this.namespace, this.usersService, this.apiRequestConfiguration)],
60+
[
61+
loginAsyncValidator(
62+
this.namespace,
63+
this.usersService,
64+
this.apiRequestConfiguration,
65+
!this.authWithoutToken
66+
),
67+
],
6168
],
6269
passwordAgainCtrl: ['', Validators.required],
6370
},

libs/perun/namespace-password-form/src/lib/perun-namespace-password-form.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const loginAsyncValidator =
2525
namespace: string,
2626
usersManager: UsersManagerService,
2727
apiRequestConfiguration: ApiRequestConfigurationService,
28+
useNon = false,
2829
time = 500
2930
) =>
3031
(input: UntypedFormControl): Observable<PasswordError | null> =>
@@ -39,7 +40,7 @@ export const loginAsyncValidator =
3940
password: input.value as string,
4041
namespace: namespace,
4142
},
42-
true
43+
useNon
4344
) as Observable<PasswordError>;
4445
}),
4546
map(() => null),

0 commit comments

Comments
 (0)