-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per 9929 show password strength #494
base: main
Are you sure you want to change the base?
Conversation
This pr displays the strength of the password when the user registers a new account.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #494 +/- ##
==========================================
+ Coverage 42.71% 42.75% +0.04%
==========================================
Files 359 359
Lines 10974 10995 +21
Branches 1793 1796 +3
==========================================
+ Hits 4687 4701 +14
- Misses 6128 6136 +8
+ Partials 159 158 -1 ☔ View full report in Codecov by Sentry. |
waiting || | ||
signupForm.invalid || | ||
!agreedTerms || | ||
passwordStrengthMessage !== 'Strong' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we want to block people from signing up just based on password strength. The intention is to show an indicator so that people can see their password strength and make their own decision on if they want to pick a stronger password.
color: red; | ||
} | ||
|
||
.strength-weak { | ||
color: orange; | ||
} | ||
|
||
.strength-medium { | ||
color: blue; | ||
} | ||
|
||
.strength-strong { | ||
color: green; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an request for changes immediately but we probably want some design/accessibility review here for color choices that match Permanent's theme and also have proper contrast against the background.
const confirmPasswordControl = new UntypedFormControl('', [ | ||
Validators.required, | ||
matchControlValidator(this.signupForm.controls['password']), | ||
]); | ||
this.signupForm.addControl('confirm', confirmPasswordControl); | ||
} | ||
|
||
ngOnInit(): void { | ||
this.signupForm.controls['password'].valueChanges.subscribe((password) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this subscription get automatically cleaned up? It might, and I'd love confirmation that it does, but I feel like subscriptions have occasionally caused errors in the application once the things they refer to have been destroyed.
passwordStrengthMessage: string = ''; | ||
passwordStrengthClass: string = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory we can make this typing even more specific with a type union. That way we know that Message
can only ever be "Strong", "Weak", etc.
In this case it might be a bit redundant but it's nice to keep that in mind, especially when testing for string equality like we do in this component.
@meisekimiu thanks! I will do the changes! @k8lyn6 can you please suggest some color values for the messages? |
@crisnicandrei we can look at it tomorrow during our accessibility review. cc @yeslikesolo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've decided this probably needs more design work before it's ready to be released. We probably don't want to erase the work already done though, so can you hide this behind a feature flag, using the FeatureFlagService
to test for its presence?
This pull request displays the strength of a user's password when registering a new account.
Steps to test: