Skip to content

Commit

Permalink
fix: hide warning for weak password unless it actually applies [DET-1…
Browse files Browse the repository at this point in the history
…0216] (#9538)

(cherry picked from commit 8f21555)
  • Loading branch information
jesse-amano-hpe authored and determined-ci committed Jun 24, 2024
1 parent ca208b9 commit 2f1283d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions webui/react/src/components/DeterminedAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ const DeterminedAuth: React.FC<Props> = ({ canceler }: Props) => {
authStore.setAuth({ isAuthenticated: true, token });
user.isPasswordWeak = isPasswordWeak(creds.password || '');
userStore.updateCurrentUser(user);
handleWarning({
level: ErrorLevel.Warn,
publicMessage:
'Your current password is either blank or weak according to current security recommendations. Please change your password.',
publicSubject: 'Weak Password',
silent: false,
type: ErrorType.Input,
});
if (user.isPasswordWeak) {
handleWarning({
level: ErrorLevel.Warn,
publicMessage:
'Your current password is either blank or weak according to current security recommendations. Please change your password.',
publicSubject: 'Weak Password',
silent: false,
type: ErrorType.Input,
});
}
if (rbacEnabled) {
// Now that we have logged in user, fetch userAssignments and userRoles and place into store.
permissionStore.fetch(canceler.signal);
Expand Down

0 comments on commit 2f1283d

Please sign in to comment.