Vulcan/packages/telescope-users/lib/config.js

90 lines
2.1 KiB
JavaScript
Raw Normal View History

2015-09-18 16:27:59 +09:00
// //////////////////////////////////
// // AccountsTemplates configuration
// //////////////////////////////////
AccountsTemplates.configure({
defaultLayout: 'layout',
defaultLayoutRegions: {},
defaultContentRegion: 'main',
enablePasswordChange: true,
showForgotPasswordLink: true,
confirmPassword: false,
overrideLoginErrors: true,
lowercaseUsername: true,
negativeFeedback: false,
positiveFeedback: false,
negativeValidation: true,
positiveValidation: true
});
AccountsTemplates.configureRoute('signIn', {
name: 'signIn',
path: '/sign-in',
});
AccountsTemplates.configureRoute('signUp', {
name: 'signUp',
path: '/register',
});
AccountsTemplates.configureRoute('changePwd');
AccountsTemplates.configureRoute('forgotPwd');
AccountsTemplates.configureRoute('resetPwd');
AccountsTemplates.configureRoute('enrollAccount');
AccountsTemplates.configureRoute('verifyEmail');
// /* global
// AccountsTemplates: false,
// Settings: false
// */
2015-03-12 10:11:48 +01:00
2014-09-20 14:21:56 +02:00
if (Meteor.isServer) {
Meteor.startup(function () {
2015-03-28 18:30:26 +09:00
Accounts.emailTemplates.siteName = Settings.get('title');
Accounts.emailTemplates.from = Settings.get('defaultEmail');
});
}
2014-09-20 14:21:56 +02:00
2015-01-28 22:22:03 +01:00
//Fields
2014-09-18 11:00:12 +02:00
AccountsTemplates.addField({
2014-12-16 09:52:28 +01:00
_id: 'username',
type: 'text',
displayName: 'username',
required: true,
minLength: 3,
errStr: 'error.minChar'
2014-09-18 11:00:12 +02:00
});
2014-09-20 12:52:14 +02:00
AccountsTemplates.removeField('email');
AccountsTemplates.addField({
_id: 'email',
type: 'email',
required: true,
re: /.+@(.+){2,}\.(.+){2,}/,
errStr: 'error.accounts.Invalid email',
});
AccountsTemplates.removeField('password');
AccountsTemplates.addField({
_id: 'password',
type: 'password',
required: true,
minLength: 8,
errStr: 'error.minChar'
2014-09-20 12:52:14 +02:00
});
2015-01-28 22:22:03 +01:00
AccountsTemplates.addField({
_id: 'username_and_email',
type: 'text',
required: true,
displayName: 'usernameOrEmail',
placeholder: 'usernameOrEmail',
});
2014-09-18 11:00:12 +02:00
2014-12-16 09:52:28 +01:00
// hack to get signOut route not considered among previous paths
if (Meteor.isClient) {
2015-09-18 16:27:59 +09:00
Meteor.startup(function(){
AccountsTemplates.knownRoutes.push('/sign-out');
});
2014-12-16 09:52:28 +01:00
}