mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Both the previous and the new value are completely arbitrary but some users suggested that we reject names like "Li" for no good reason, especially on private boards, cf #202. Hopefully one day we'll have an administrator configuration panel. Fixes #202 Closes #210
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
var passwordField = AccountsTemplates.removeField('password');
|
|
var emailField = AccountsTemplates.removeField('email');
|
|
AccountsTemplates.addFields([{
|
|
_id: 'username',
|
|
type: 'text',
|
|
displayName: 'username',
|
|
required: true,
|
|
minLength: 2
|
|
}, emailField, passwordField]);
|
|
|
|
AccountsTemplates.configure({
|
|
defaultLayout: 'userFormsLayout',
|
|
defaultContentRegion: 'content',
|
|
confirmPassword: false,
|
|
enablePasswordChange: true,
|
|
sendVerificationEmail: true,
|
|
showForgotPasswordLink: true,
|
|
onLogoutHook: function() {
|
|
var homePage = 'home';
|
|
if (FlowRouter.getRouteName() === homePage) {
|
|
FlowRouter.reload();
|
|
} else {
|
|
FlowRouter.go(homePage);
|
|
}
|
|
}
|
|
});
|
|
|
|
_.each(['signIn', 'signUp', 'resetPwd', 'forgotPwd', 'enrollAccount'],
|
|
function(routeName) {
|
|
AccountsTemplates.configureRoute(routeName);
|
|
});
|
|
|
|
// We display the form to change the password in a popup window that already
|
|
// have a title, so we unset the title automatically displayed by useraccounts.
|
|
AccountsTemplates.configure({
|
|
texts: {
|
|
title: {
|
|
changePwd: ''
|
|
}
|
|
}
|
|
});
|
|
|
|
AccountsTemplates.configureRoute('changePwd', {
|
|
redirect: function() {
|
|
// XXX We should emit a notification once we have a notification system.
|
|
// Currently the user has no indication that his modification has been
|
|
// applied.
|
|
Popup.back();
|
|
}
|
|
});
|