Skip to content
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

Add password complexity checks for openhab-cloud account #80

Merged
merged 1 commit into from
Apr 22, 2017

Conversation

FlorianSW
Copy link
Member

All places, where a password can be set will now go through a new class,
UserPassword, which will check the password complexity before setting the
password to the user account. It also provides a check method to check the
complexity requirements before a user account will be created. If the
complexity rules aren't met, the save of the password will be denied and an
error message with the complexity rules is shown.

Fixes #75

All places, where a password can be set will now go through a new class,
UserPassword, which will check the password complexity before setting the
password to the user account. It also provides a check method to check the
complexity requirements before a user account will be created. If the
complexity rules aren't met, the save of the password will be denied and an
error message with the complexity rules is shown.

Fixes openhab#75
@marziman
Copy link
Contributor

@FlorianSW,
thanks! Going to review this as soon as possible
BR Mehmet

@digitaldan digitaldan self-assigned this Apr 20, 2017
@digitaldan
Copy link
Contributor

Hi @FlorianSW this works well when changing a password, but we also let users choose a password when they create an account and I don't think this is getting used there?

@@ -343,6 +354,12 @@ exports.registerpost = function(req, res) {
res.render('login', { title: "Login / Sign up", user: req.user,
errormessages:req.flash('error'), infomessages:req.flash('info') });
} else {
if (!UserPassword.isComplexEnough(req.body.password)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the place where a user selected a password during registration, isn't it?

@FlorianSW
Copy link
Member Author

Hi @digitaldan :) Thanks for your review! It's totally possible, that I missed a place, however, see my comment, where I think the registration password should be handled? Do I miss another place, too? Thanks for your help :)

@digitaldan
Copy link
Contributor

It looks like it, but for some reason it let me create an account with 1234 as my password, let me try again and make sure my password manager didn't autofill something in right before i hit submit (lastpass does that sometimes).

@FlorianSW
Copy link
Member Author

Interesting, I checked this, too (I remember that, because I already wrote git push and remembered, that I forgot to change behaviour of the register form and I had to implement that before I pushed :P). I'll check that again, just to be sure :)

@digitaldan
Copy link
Contributor

I just tried it again and now it works, I'm going to blame lastpass :-)

@digitaldan digitaldan merged commit 2dc275a into openhab:master Apr 22, 2017
@FlorianSW
Copy link
Member Author

I tested it again, too, and it's working great yeah

Thanks for merging!

@marziman
Copy link
Contributor

@FlorianSW looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants