Files
Phraseanet/Phraseanet-production-client/src/components/authentication/renewPassword.js
2024-02-16 18:15:04 +01:00

46 lines
1.4 KiB
JavaScript

/*
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import $ from 'jquery';
import RenewPasswordForm from './common/forms/views/formType/passwordSetter';
const renewPassword = (services) => {
const {configService, localeService, appEvents} = services;
const initialize = () => {
require.ensure([], () => {
services.zxcvbn = require('zxcvbn');
new RenewPasswordForm({
services,
el: $('form[name=passwordRenewForm]'),
rules: [
{
name: 'password[password]',
rules: 'required',
message: localeService.t('validation_blank')
},
{
name: 'password[password]',
rules: 'min_length[5]',
message: localeService.t('validation_length_min')
},
{
name: 'password[confirm]',
rules: 'matches[password[password]]',
message: localeService.t('password_match')
}
]
});
});
};
return {initialize};
};
export default renewPassword;