diff options
| author | LV-426 <lv-426@taproot.org.il> | 2015-02-23 14:45:08 +0200 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2015-02-23 15:07:53 +0200 |
| commit | d188bc02a9ff357465fc926fe0b3f0a45465d1a5 (patch) | |
| tree | e104b51baf9bbaad746b61c3af188cb57a539186 /src/client/util.js | |
| parent | b1c701c17815f54e4bf0b8e6ff845d37fd0a4709 (diff) | |
util.js: input_validation__password()
Diffstat (limited to 'src/client/util.js')
| -rw-r--r-- | src/client/util.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/util.js b/src/client/util.js index a041c813..ca644fed 100644 --- a/src/client/util.js +++ b/src/client/util.js @@ -74,6 +74,15 @@ define(['jquery'], function($) { }); } + function input_validation__password(password_first, password_second) { + if (password_first != password_second) { + throw { message: 'passwords do not match' } + } + if (password_first.length < 8) { + throw { message: 'password too short - must be at least 8 charachters long' } + } + } + return { assert: assert, set_from_array: set_from_array, @@ -82,5 +91,6 @@ define(['jquery'], function($) { array_diff: array_diff, getParameterByName: getParameterByName, form_common__rest_post: form_common__rest_post, + input_validation__password: input_validation__password, }; }); |
