{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1565","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1565/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1565/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1565/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/1565","id":84539445,"number":1565,"title":"Password length on server side is not checked correct","user":{"login":"wuethrich44","id":6050639,"avatar_url":"https://avatars.githubusercontent.com/u/6050639?v=3","gravatar_id":"","url":"https://api.github.com/users/wuethrich44","html_url":"https://github.com/wuethrich44","followers_url":"https://api.github.com/users/wuethrich44/followers","following_url":"https://api.github.com/users/wuethrich44/following{/other_user}","gists_url":"https://api.github.com/users/wuethrich44/gists{/gist_id}","starred_url":"https://api.github.com/users/wuethrich44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuethrich44/subscriptions","organizations_url":"https://api.github.com/users/wuethrich44/orgs","repos_url":"https://api.github.com/users/wuethrich44/repos","events_url":"https://api.github.com/users/wuethrich44/events{/privacy}","received_events_url":"https://api.github.com/users/wuethrich44/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-03T12:36:26Z","updated_at":"2015-06-05T09:35:16Z","closed_at":null,"body":"Today i wanna change the password length to 8 chars. Then I noticed while the password reset the password is not checked on the server side in this method: \r\n```java\r\npublic Optional<User> completePasswordReset(String newPassword, String key) {}\r\n```\r\nDuring the registration the password length is check in the UserDTO and while the password change there is a fix in this PR https://github.com/jhipster/generator-jhipster/commit/16fb9338e46554581ee3a709b2c2ca9388cb3abd.\r\n\r\nFurthermore the `@Size(min=5, max=100)` in the user entity password is useless because the password hash has a fix length.\r\n\r\nI suggest two options to unify the password length check:\r\n\r\n- Make all password changes with the UserDTO and use the `@Size` in this DTO\r\n- Read the password length from the settings and fix this problem like in this PR https://github.com/jhipster/generator-jhipster/commit/16fb9338e46554581ee3a709b2c2ca9388cb3abd\r\n\r\nThen I recommend to set the `@Size` from the user entity password field to this `@Size(min=60, max=60)` because the bcrypt hash produce 60 char length strings and rename the field to something like `passwordHash`.\r\n\r\nWhat do you think about this suggestions?"},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/109217608","html_url":"https://github.com/jhipster/generator-jhipster/issues/1565#issuecomment-109217608","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1565","id":109217608,"user":{"login":"wuethrich44","id":6050639,"avatar_url":"https://avatars.githubusercontent.com/u/6050639?v=3","gravatar_id":"","url":"https://api.github.com/users/wuethrich44","html_url":"https://github.com/wuethrich44","followers_url":"https://api.github.com/users/wuethrich44/followers","following_url":"https://api.github.com/users/wuethrich44/following{/other_user}","gists_url":"https://api.github.com/users/wuethrich44/gists{/gist_id}","starred_url":"https://api.github.com/users/wuethrich44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuethrich44/subscriptions","organizations_url":"https://api.github.com/users/wuethrich44/orgs","repos_url":"https://api.github.com/users/wuethrich44/repos","events_url":"https://api.github.com/users/wuethrich44/events{/privacy}","received_events_url":"https://api.github.com/users/wuethrich44/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T09:35:16Z","updated_at":"2015-06-05T09:35:16Z","body":"nice thanks :+1: "}}