diff options
Diffstat (limited to 'client/config')
-rw-r--r-- | client/config/accounts.js | 35 | ||||
-rw-r--r-- | client/config/avatar.js | 3 | ||||
-rw-r--r-- | client/config/router.js | 28 |
3 files changed, 66 insertions, 0 deletions
diff --git a/client/config/accounts.js b/client/config/accounts.js new file mode 100644 index 00000000..9e0d17d3 --- /dev/null +++ b/client/config/accounts.js @@ -0,0 +1,35 @@ +AccountsTemplates.configure({ + confirmPassword: false, + enablePasswordChange: true, + sendVerificationEmail: true, + showForgotPasswordLink: true +}); + +AccountsTemplates.removeField('password'); +AccountsTemplates.removeField('email'); +AccountsTemplates.addFields([ + { + _id: 'username', + type: 'text', + displayName: 'username', + required: true, + minLength: 5 + }, + { + _id: 'email', + type: 'email', + required: true, + displayName: 'email', + re: /.+@(.+){2,}\.(.+){2,}/, + errStr: 'Invalid email' + }, + { + _id: 'password', + type: 'password', + placeholder: { + signUp: 'At least six characters' + }, + required: true, + minLength: 6 + } +]); diff --git a/client/config/avatar.js b/client/config/avatar.js new file mode 100644 index 00000000..fc4ba58b --- /dev/null +++ b/client/config/avatar.js @@ -0,0 +1,3 @@ +Avatar.options = { + fallbackType: 'initials' +}; diff --git a/client/config/router.js b/client/config/router.js new file mode 100644 index 00000000..c859013f --- /dev/null +++ b/client/config/router.js @@ -0,0 +1,28 @@ +Router.configure({ + loadingTemplate: 'spinner', + notFoundTemplate: 'notfound', + layoutTemplate: 'defaultLayout', + + onBeforeAction: function() { + var options = this.route.options; + + // Redirect logged in users to Boards view when they try to open Login or + // signup views. + if (Meteor.userId() && options.redirectLoggedInUsers) { + return this.redirect('Boards'); + } + + // Authenticated + if (! Meteor.userId() && options.authenticated) { + return this.redirect('atSignIn'); + } + + // Reset default sessions + Session.set('error', false); + Session.set('warning', false); + + Popup.close(); + + this.next(); + } +}); |