Javascript error when local password policy configured and password tab disabled in menu
If local password policy is configured but password tab is not enabled in menu, portal javascript is failing:
Uncaught TypeError: $(...)[0] is undefined
checkpassword https://auth.xxx/static/common/js/portal.js:502
<anonymous> https://auth.xxx/static/common/js/portal.js:506
jQuery 8
<anonymous> https://auth.xxx/static/bootstrap/js/skin.js:1
portal.js:502:10
checkpassword https://auth.xxx/static/common/js/portal.js:502
<anonyme> https://auth.xxx/static/common/js/portal.js:506
jQuery 8
<anonyme> https://auth.xxx/static/bootstrap/js/skin.js:1
This can happen if we only display the password tab to a subset of users.
In portal.coffee, we should only call checkpassword if there is a password input to check:
if window.datas.ppolicy?
# Initialize display
checkpassword ''