1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
var passwordField = AccountsTemplates.removeField('password');
var emailField = AccountsTemplates.removeField('email');
AccountsTemplates.addFields([{
_id: 'username',
type: 'text',
displayName: 'username',
required: true,
minLength: 5
}, emailField, passwordField]);
AccountsTemplates.configure({
confirmPassword: false,
enablePasswordChange: true,
sendVerificationEmail: true,
showForgotPasswordLink: true,
onLogoutHook: function() {
Router.go('Home');
}
});
_.each(['signIn', 'signUp', 'resetPwd', 'forgotPwd', 'enrollAccount'],
function(routeName) {
AccountsTemplates.configureRoute(routeName, {
layoutTemplate: 'userFormsLayout'
});
});
// 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();
}
});
|