-
Notifications
You must be signed in to change notification settings - Fork 365
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
Test coverages for hashed password #893
Conversation
e5aafe0
to
75b71d0
Compare
// Check that it has not been already hashed | ||
if (pos === -1 || | ||
(plain.substr(0, pos).toUpperCase() !== plain.substr(pos + 1, plain.length))) | ||
this.$password = plain + '-' + plain.toUpperCase(); |
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.
Uff, this is rather difficult to understand. Could you please split the code into smaller steps and save intermediate results into named variables? Something like this:
var hashed = false;
var pos = plain.indexOf('-');
if (pos !== -1) {
var head = plain.substr(0, pos);
var tail = plain.substr(pos + 1, plain.length);
hashed = head.toUpperCase() === tail;
}
if (hashed) return;
this.$password = plain + '-' + plain.toUpperCase();
116c19f
to
4be50ff
Compare
Thanks @bajtos , In case if my comment gets lost: #893 (comment) I believe #896 needs to be landed first.
Yes without the fix the added test was failing. 👍 Thanks! |
LGTM. Let's get #896 landed first and the re-run the CI builds before landing this one, to make sure they pass. |
@slnode test please |
* Test coverages for hashed password for replaceAttributes * Test coverages for hashed password for updateAttribute
4be50ff
to
11ef948
Compare
Also back-ported the commit to |
Connect to strongloop/loopback#2029
Notes:
Connect to #896
#896 needs to be landed before this patch (PR#893)
@bajtos: Please review... Thanks!