From df03d0033c1d8ddd9b1a0d705cd675421b2fbe83 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 2 Oct 2014 23:35:45 +0200 Subject: [PATCH 01/15] Fixed typo and added userCredential parameter for redirect --- README.md | 2 ++ client/views/signUp/signUp.coffee | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 79c1fa16..b15a647b 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ Since this is a young package, we are maintaining compatibility with accounts-ui dashboardRoute: '/dashboard' // mandatory - path to redirect to after successful sign-in profileRoute: 'profile' passwordSignupFields: 'EMAIL_ONLY' + veryfyEmail: false // if set to true - the sendVerificationEmail setting needs also be set on Accounts.config + veryfyEmailRoute: '/checkmail' // route get user redirected after registering a new user profile showSignupCode: true showOtherLoginServices: true // Set to false to hide oauth login buttons on the signin/signup pages. Useful if you are using something like accounts-meld or want to oauth for api access extraSignUpFields: [{ // Add extra signup fields on the signup page diff --git a/client/views/signUp/signUp.coffee b/client/views/signUp/signUp.coffee index 8a253d66..03f9a5f7 100644 --- a/client/views/signUp/signUp.coffee +++ b/client/views/signUp/signUp.coffee @@ -147,15 +147,20 @@ AccountsEntry.entrySignUpEvents = { 'USERNAME_AND_EMAIL', 'EMAIL_ONLY'], AccountsEntry.settings.passwordSignupFields) userCredential = if isEmailSignUp then email else username - Meteor.loginWithPassword userCredential, password, (error) -> - if error - console.log err - T9NHelper.accountsError error - else if Session.get 'fromWhere' - Router.go Session.get('fromWhere') - Session.set 'fromWhere', undefined - else - Router.go AccountsEntry.settings.dashboardRoute + + + if AccountsEntry.settings.veryfyEmail + Router.go AccountsEntry.settings.veryfyEmailRoute + else + Meteor.loginWithPassword userCredential, password, (error) -> + if error + console.log err + T9NHelper.accountsError error + else if Session.get 'fromWhere' + Router.go Session.get('fromWhere') + Session.set 'fromWhere', undefined + else + Router.go AccountsEntry.settings.dashboardRoute else console.log err Session.set 'entryError', t9n("error.signupCodeIncorrect") From 1f36f709a5baf6b6de0a5ca98ee630aba916382e Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 2 Oct 2014 23:58:37 +0200 Subject: [PATCH 02/15] fixed typo --- README.md | 4 ++-- client/views/signUp/signUp.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b15a647b..79f131bd 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,8 @@ Since this is a young package, we are maintaining compatibility with accounts-ui dashboardRoute: '/dashboard' // mandatory - path to redirect to after successful sign-in profileRoute: 'profile' passwordSignupFields: 'EMAIL_ONLY' - veryfyEmail: false // if set to true - the sendVerificationEmail setting needs also be set on Accounts.config - veryfyEmailRoute: '/checkmail' // route get user redirected after registering a new user profile + verifyEmail: false // if set to true - the sendVerificationEmail setting needs also be set on Accounts.config + verifyEmailRoute: '/checkmail' // route get user redirected after registering a new user profile showSignupCode: true showOtherLoginServices: true // Set to false to hide oauth login buttons on the signin/signup pages. Useful if you are using something like accounts-meld or want to oauth for api access extraSignUpFields: [{ // Add extra signup fields on the signup page diff --git a/client/views/signUp/signUp.coffee b/client/views/signUp/signUp.coffee index 03f9a5f7..bb980780 100644 --- a/client/views/signUp/signUp.coffee +++ b/client/views/signUp/signUp.coffee @@ -149,8 +149,8 @@ AccountsEntry.entrySignUpEvents = { userCredential = if isEmailSignUp then email else username - if AccountsEntry.settings.veryfyEmail - Router.go AccountsEntry.settings.veryfyEmailRoute + if AccountsEntry.settings.verifyEmail + Router.go AccountsEntry.settings.verifyEmailRoute userCredential else Meteor.loginWithPassword userCredential, password, (error) -> if error From df1395be1edb2c092d9a4d7735166863f2c7f269 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Fri, 3 Oct 2014 00:40:19 +0200 Subject: [PATCH 03/15] fixed Routes.go call --- client/views/signUp/signUp.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/views/signUp/signUp.coffee b/client/views/signUp/signUp.coffee index bb980780..039887bd 100644 --- a/client/views/signUp/signUp.coffee +++ b/client/views/signUp/signUp.coffee @@ -148,9 +148,8 @@ AccountsEntry.entrySignUpEvents = { 'EMAIL_ONLY'], AccountsEntry.settings.passwordSignupFields) userCredential = if isEmailSignUp then email else username - if AccountsEntry.settings.verifyEmail - Router.go AccountsEntry.settings.verifyEmailRoute userCredential + Router.go AccountsEntry.settings.verifyEmailRoute else Meteor.loginWithPassword userCredential, password, (error) -> if error From c38e769a0f8ba0e28025090c706e03e74b26eeb3 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Fri, 10 Oct 2014 10:25:32 +0200 Subject: [PATCH 04/15] bump --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 79f131bd..9f73a4cd 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ version: 0.9.0 --- +Bump + **NOTE:** Version 0.8.0 and higher or accounts-entry requires that you use Meteor 0.8.2 or higher. You also need to pass the pause param to AccountsEntry.signedInRequired if you are using it. If you were using master and extraSignUpFields, please review the docs for changes in the 0.8.0 release. # accounts-entry From 8e255207d8de77d922925684af10b726688dcc40 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 23 Oct 2014 12:42:31 +0200 Subject: [PATCH 05/15] updated git link --- package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.js b/package.js index 1a32f028..526acaf6 100644 --- a/package.js +++ b/package.js @@ -1,7 +1,7 @@ Package.describe({ summary: "Make signin and signout their own pages with routes.", version: '0.9.0', - git: 'https://github.com/Differential/accounts-entry' + git: 'https://github.com/Vilango/accounts-entry' }); Package.onUse(function(api) { From bb1ea1fce3868ce0872314b36e74d5279ad2fa92 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 23 Oct 2014 12:57:22 +0200 Subject: [PATCH 06/15] changed version --- package.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.js b/package.js index 526acaf6..da9b61fa 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,7 @@ Package.describe({ + name: 'vilango:accounts-entry', summary: "Make signin and signout their own pages with routes.", - version: '0.9.0', + version: '0.9.0-1', git: 'https://github.com/Vilango/accounts-entry' }); From d90b46a81fc90e993d10c0c4603f125fd317b773 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Sat, 25 Oct 2014 10:06:40 +0200 Subject: [PATCH 07/15] pushed version 0.9.0-1 --- package.js | 10 +++++----- versions.json | 52 +++++++++++++++++++++++++++++---------------------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/package.js b/package.js index da9b61fa..273a892e 100644 --- a/package.js +++ b/package.js @@ -18,7 +18,7 @@ Package.onUse(function(api) { 'handlebars', 'session', 'coffeescript', - 'simple-form', + 'joshowens:simple-form@0.2.0', 'less', 'sha'] , 'client'); @@ -75,7 +75,7 @@ Package.onUse(function(api) { api.imply('accounts-base', ['client', 'server']); api.imply('accounts-password', ['client', 'server']); api.export('AccountsEntry', ['client', 'server']); - api.use(['iron:router', 'mrt:accounts-t9n'], ['client', 'server']); + api.use(['iron:router@0.9.0', 'softwarerero:accounts-t9n@1.0.0'], ['client', 'server']); api.addFiles(['shared/router.coffee'], ['client', 'server']); }); @@ -88,9 +88,9 @@ Package.onTest(function (api) { 'templating', 'mongo-livedata', 'coffeescript', - 'simple-form', - 'iron-router']); - api.use('accounts-entry'); + 'joshowens:simple-form', + 'iron:router']); + //api.use('accounts-entry'); api.addFiles(['tests/route.coffee', 'tests/client.html', 'tests/client.coffee'], 'client'); }) diff --git a/versions.json b/versions.json index ce24090b..d0c0b004 100644 --- a/versions.json +++ b/versions.json @@ -8,10 +8,6 @@ "accounts-password", "1.0.0" ], - [ - "accounts-t9n", - "0.0.0" - ], [ "application-configuration", "1.0.0" @@ -22,11 +18,7 @@ ], [ "blaze", - "1.0.2" - ], - [ - "blaze-layout", - "0.0.0" + "1.0.3" ], [ "blaze-tools", @@ -46,7 +38,7 @@ ], [ "deps", - "1.0.0" + "1.0.1" ], [ "ejson", @@ -81,8 +73,24 @@ "1.0.0" ], [ - "iron-router", - "0.0.0" + "iron:core", + "0.3.2" + ], + [ + "iron:dynamic-template", + "0.3.0" + ], + [ + "iron:layout", + "0.3.0" + ], + [ + "iron:router", + "0.9.1" + ], + [ + "joshowens:simple-form", + "0.2.0" ], [ "jquery", @@ -94,11 +102,11 @@ ], [ "less", - "1.0.4" + "1.0.5" ], [ "livedata", - "1.0.4" + "1.0.7" ], [ "localstorage", @@ -122,7 +130,11 @@ ], [ "mongo-livedata", - "1.0.2" + "1.0.3" + ], + [ + "mrt:underscore-string-latest", + "2.3.3" ], [ "npm-bcrypt", @@ -165,8 +177,8 @@ "1.0.0" ], [ - "simple-form", - "0.0.0" + "softwarerero:accounts-t9n", + "1.0.0" ], [ "spacebars", @@ -192,16 +204,12 @@ "underscore", "1.0.0" ], - [ - "underscore-string-latest", - "0.0.0" - ], [ "webapp", "1.0.2" ] ], "pluginDependencies": [], - "toolVersion": "meteor-tool@1.0.12", + "toolVersion": "meteor-tool@1.0.34", "format": "1.0" } \ No newline at end of file From 5b03409089d0fa255201e5ee7f05c8ea7523727a Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Tue, 4 Nov 2014 14:48:27 +0100 Subject: [PATCH 08/15] fix for makeing api calls to iron router possible --- package.js | 2 +- shared/router.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.js b/package.js index 273a892e..97fbb270 100644 --- a/package.js +++ b/package.js @@ -1,7 +1,7 @@ Package.describe({ name: 'vilango:accounts-entry', summary: "Make signin and signout their own pages with routes.", - version: '0.9.0-1', + version: '0.9.0-2', git: 'https://github.com/Vilango/accounts-entry' }); diff --git a/shared/router.coffee b/shared/router.coffee index e4db4d3f..d5d75fe2 100644 --- a/shared/router.coffee +++ b/shared/router.coffee @@ -82,5 +82,5 @@ _.each Router.routes, (route)-> # Change the fromWhere session variable when you leave a path Router.onStop -> # If the route is an entry route, no need to save it - if (!_.contains(exclusions, Router.current().route.name)) - Session.set('fromWhere', Router.current().path) + if (!_.contains(exclusions, Router.current?().route.name)) + Session.set('fromWhere', Router.current?().path) From 7bb5a04e9ea07738f5366452a9d0ea41ecc83d72 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Tue, 4 Nov 2014 14:53:48 +0100 Subject: [PATCH 09/15] fix for makeing api calls to iron router possible --- package.js | 2 +- shared/router.coffee | 5 +++-- versions.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.js b/package.js index 97fbb270..1f7a81a4 100644 --- a/package.js +++ b/package.js @@ -1,7 +1,7 @@ Package.describe({ name: 'vilango:accounts-entry', summary: "Make signin and signout their own pages with routes.", - version: '0.9.0-2', + version: '0.9.0-3', git: 'https://github.com/Vilango/accounts-entry' }); diff --git a/shared/router.coffee b/shared/router.coffee index d5d75fe2..5e9d061b 100644 --- a/shared/router.coffee +++ b/shared/router.coffee @@ -82,5 +82,6 @@ _.each Router.routes, (route)-> # Change the fromWhere session variable when you leave a path Router.onStop -> # If the route is an entry route, no need to save it - if (!_.contains(exclusions, Router.current?().route.name)) - Session.set('fromWhere', Router.current?().path) + if Meteor.isClient + if (!_.contains(exclusions, Router.current().route.name)) + Session.set('fromWhere', Router.current().path) diff --git a/versions.json b/versions.json index d0c0b004..fb719b5b 100644 --- a/versions.json +++ b/versions.json @@ -210,6 +210,6 @@ ] ], "pluginDependencies": [], - "toolVersion": "meteor-tool@1.0.34", + "toolVersion": "meteor-tool@1.0.35", "format": "1.0" } \ No newline at end of file From f7e1e6644b452fc76276285795be08bfe11dd0d2 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 11 Jun 2015 17:57:41 +0200 Subject: [PATCH 10/15] working version --- README.md | 6 +----- client/entry.coffee | 7 ++++++- client/helpers.coffee | 2 +- .../forgotPassword/forgotPassword.coffee | 17 ++++++++++++++-- .../views/resetPassword/resetPassword.coffee | 9 ++++++++- client/views/signIn/signIn.coffee | 5 +++++ client/views/signUp/extraSignUpFields.coffee | 20 ++++++++++++++++++- client/views/signUp/extraSignUpFields.html | 6 ++++++ client/views/signUp/signUp.coffee | 19 ++++++++++++++++-- client/views/signUp/signUp.html | 4 ++-- package.js | 11 +++++----- server/entry.coffee | 4 ++++ shared/router.coffee | 11 ++++++---- 13 files changed, 96 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 9f73a4cd..4fbacd4f 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,10 @@ layout: default username: Differential repo: accounts-entry desc: Meteor sign up and sign in pages. -version: 0.9.0 +version: 1.0.3-2 --- -Bump - **NOTE:** Version 0.8.0 and higher or accounts-entry requires that you use Meteor 0.8.2 or higher. You also need to pass the pause param to AccountsEntry.signedInRequired if you are using it. If you were using master and extraSignUpFields, please review the docs for changes in the 0.8.0 release. # accounts-entry @@ -111,8 +109,6 @@ Since this is a young package, we are maintaining compatibility with accounts-ui dashboardRoute: '/dashboard' // mandatory - path to redirect to after successful sign-in profileRoute: 'profile' passwordSignupFields: 'EMAIL_ONLY' - verifyEmail: false // if set to true - the sendVerificationEmail setting needs also be set on Accounts.config - verifyEmailRoute: '/checkmail' // route get user redirected after registering a new user profile showSignupCode: true showOtherLoginServices: true // Set to false to hide oauth login buttons on the signin/signup pages. Useful if you are using something like accounts-meld or want to oauth for api access extraSignUpFields: [{ // Add extra signup fields on the signup page diff --git a/client/entry.coffee b/client/entry.coffee index 8166c336..4c7fb47d 100644 --- a/client/entry.coffee +++ b/client/entry.coffee @@ -10,6 +10,10 @@ AccountsEntry = extraSignUpFields: [] showOtherLoginServices: true + hooks: + afterSignUpHook: (newUserId)-> + console.log "afterSignUp hook", newUserId + isStringEmail: (email) -> emailPattern = /^([\w.-]+)@([\w.-]+)\.([a-zA-Z.]{2,6})$/i if email.match emailPattern then true else false @@ -29,11 +33,12 @@ AccountsEntry = extraCondition ?= true unless Meteor.loggingIn() if Meteor.user() and extraCondition - router.next() + #router.next() else Session.set('fromWhere', router.url) Router.go('/sign-in') Session.set('entryError', t9n('error.signInRequired')) + #router.next() @AccountsEntry = AccountsEntry diff --git a/client/helpers.coffee b/client/helpers.coffee index fb084259..013a5b86 100644 --- a/client/helpers.coffee +++ b/client/helpers.coffee @@ -37,4 +37,4 @@ UI.registerHelper 'passwordLoginService', -> !!Package['accounts-password'] UI.registerHelper 'showCreateAccountLink', -> - return !Accounts._options.forbidClientAccountCreation + return !Accounts._options.forbidClientAccountCreation \ No newline at end of file diff --git a/client/views/forgotPassword/forgotPassword.coffee b/client/views/forgotPassword/forgotPassword.coffee index 4f388207..c9f9305d 100644 --- a/client/views/forgotPassword/forgotPassword.coffee +++ b/client/views/forgotPassword/forgotPassword.coffee @@ -7,10 +7,21 @@ Template.entryForgotPassword.helpers Template.entryForgotPassword.events 'submit #forgotPassword': (event) -> event.preventDefault() - Session.set('email', $('input[name="forgottenEmail"]').val()) + Session.set('entryError', null) + + email = $('input[name="forgottenEmail"]').val() + if (AccountsEntry.isStringEmail(email) and AccountsEntry.settings.emailToLower) or + (not AccountsEntry.isStringEmail(email) and AccountsEntry.settings.usernameToLower) + email = email.toLowerCase() + + Session.set('email', email) + $btns = $(event.target).find("button[type='submit']") + Helper.disableBtns($btns) if Session.get('email').length is 0 Session.set('entryError', 'Email is required') + + Helper.enableBtns($btns) return Accounts.forgotPassword({ @@ -19,5 +30,7 @@ Template.entryForgotPassword.events if error Session.set('entryError', error.reason) else - Router.go AccountsEntry.settings.homeRoute + Router.go AccountsEntry.settings.resetPasswordSuccessRoute + + Helper.enableBtns($btns) ) diff --git a/client/views/resetPassword/resetPassword.coffee b/client/views/resetPassword/resetPassword.coffee index d957dfd2..9307f4df 100644 --- a/client/views/resetPassword/resetPassword.coffee +++ b/client/views/resetPassword/resetPassword.coffee @@ -8,6 +8,9 @@ Template.entryResetPassword.events 'submit #resetPassword': (event) -> event.preventDefault() + $btns = $(event.target).find("button[type='submit']") + Helper.disableBtns($btns) + password = $('input[type="password"]').val() passwordErrors = do (password)-> @@ -30,7 +33,9 @@ Template.entryResetPassword.events return false - if passwordErrors then return + if passwordErrors + Helper.enableBtns($btns) + return Accounts.resetPassword Session.get('resetToken'), password, (error) -> if error @@ -38,3 +43,5 @@ Template.entryResetPassword.events else Session.set('resetToken', null) Router.go AccountsEntry.settings.dashboardRoute + + Helper.enableBtns($btns) \ No newline at end of file diff --git a/client/views/signIn/signIn.coffee b/client/views/signIn/signIn.coffee index 96bfb682..2902a7cf 100644 --- a/client/views/signIn/signIn.coffee +++ b/client/views/signIn/signIn.coffee @@ -30,6 +30,9 @@ AccountsEntry.entrySignInEvents = { 'submit #signIn': (event) -> event.preventDefault() + $btns = $(event.target).find("button[type='submit']") + Helper.disableBtns($btns) + email = $('input[name="email"]').val() if (AccountsEntry.isStringEmail(email) and AccountsEntry.settings.emailToLower) or (not AccountsEntry.isStringEmail(email) and AccountsEntry.settings.usernameToLower) @@ -47,6 +50,8 @@ AccountsEntry.entrySignInEvents = { Session.set('fromWhere', undefined) else Router.go AccountsEntry.settings.dashboardRoute + + Helper.enableBtns($btns) ) } diff --git a/client/views/signUp/extraSignUpFields.coffee b/client/views/signUp/extraSignUpFields.coffee index 1b240d03..808aed75 100644 --- a/client/views/signUp/extraSignUpFields.coffee +++ b/client/views/signUp/extraSignUpFields.coffee @@ -4,7 +4,25 @@ Template.entryExtraSignUpFields.helpers Template._entryExtraSignUpField.helpers isTextField: -> - @type isnt "check_box" + @type isnt "check_box" and @type isnt "select_box" isCheckbox: -> @type is "check_box" + + isSelectbox: -> + @type is "select_box" + + + +# Added by GB +Template.entryExtraSignUpFields.events + 'change select.languageCode': (evt) -> + newLang = $(evt.target).val(); + console.log "Template.entryExtraSignUpFields.events","change languageCode", newLang + i18n.setLanguage(newLang) + +Template.entryExtraSignUpFields.rendered = -> + $select = $("select.languageCode") + if $select + $("select.languageCode").val(i18n.getLanguage()) + \ No newline at end of file diff --git a/client/views/signUp/extraSignUpFields.html b/client/views/signUp/extraSignUpFields.html index fdd5275a..223d4cf1 100644 --- a/client/views/signUp/extraSignUpFields.html +++ b/client/views/signUp/extraSignUpFields.html @@ -16,4 +16,10 @@ {{check_box name label=label required=required}} {{/if}} + + {{#if isSelectbox}} +
+ {{select_box field class=field optionValues=optionValues type=type label=label required=required}} +
+ {{/if}} diff --git a/client/views/signUp/signUp.coffee b/client/views/signUp/signUp.coffee index 30d8e6f6..9ca1eef8 100644 --- a/client/views/signUp/signUp.coffee +++ b/client/views/signUp/signUp.coffee @@ -52,6 +52,10 @@ AccountsEntry.entrySignUpEvents = { 'submit #signUp': (event, t) -> event.preventDefault() + $btns = $(event.target).find("button[type='submit']") + Helper.disableBtns($btns) + + username = if t.find('input[name="username"]') t.find('input[name="username"]').value.toLowerCase() @@ -103,7 +107,9 @@ AccountsEntry.entrySignUpEvents = { return false - if passwordErrors then return + if passwordErrors + Helper.enableBtns($btns) + return emailRequired = _.contains([ 'USERNAME_AND_EMAIL', @@ -115,18 +121,22 @@ AccountsEntry.entrySignUpEvents = { if usernameRequired && username.length is 0 Session.set('entryError', t9n("error.usernameRequired")) + Helper.enableBtns($btns) return if username && AccountsEntry.isStringEmail(username) Session.set('entryError', t9n("error.usernameIsEmail")) + Helper.enableBtns($btns) return if emailRequired && email.length is 0 Session.set('entryError', t9n("error.emailRequired")) + Helper.enableBtns($btns) return if AccountsEntry.settings.showSignupCode && signupCode.length is 0 Session.set('entryError', t9n("error.signupCodeRequired")) + Helper.enableBtns($btns) return @@ -137,11 +147,15 @@ AccountsEntry.entrySignUpEvents = { email: email password: AccountsEntry.hashPassword(password) profile: filteredExtraFields - Meteor.call 'entryCreateUser', newUserData, (err, data) -> + Meteor.call 'entryCreateUser', newUserData, (err, newUserId) -> if err console.log err T9NHelper.accountsError err + Helper.enableBtns($btns) return + + AccountsEntry.hooks.afterSignUpHook(newUserId) + #login on client isEmailSignUp = _.contains([ 'USERNAME_AND_EMAIL', @@ -163,6 +177,7 @@ AccountsEntry.entrySignUpEvents = { else console.log err Session.set 'entryError', t9n("error.signupCodeIncorrect") + Helper.enableBtns($btns) return } diff --git a/client/views/signUp/signUp.html b/client/views/signUp/signUp.html index b2a693c0..1d2eeddf 100644 --- a/client/views/signUp/signUp.html +++ b/client/views/signUp/signUp.html @@ -65,8 +65,8 @@

{{t9n "createAccount"}}

{{/if}} {{#if both}}

{{t9n "clickAgree"}} - {{t9n "privacyPolicy"}} {{t9n "and"}} - {{t9n "terms"}}. + {{t9n "privacyPolicy"}} {{t9n "and"}} + {{t9n "terms"}}.

{{else}} {{#unless neither}} diff --git a/package.js b/package.js index f5a2512b..31e54378 100644 --- a/package.js +++ b/package.js @@ -1,14 +1,13 @@ Package.describe({ - name: 'vilango:accounts-entry', summary: "Make signin and signout their own pages with routes.", - version: '1.0.0-1', - git: 'https://github.com/Vilango/accounts-entry' -}); + version: '1.0.3-2', + name: "vilango:accounts-entry" + }); Package.onUse(function(api) { api.versionsFrom("METEOR@0.9.0"); - api.use(['iron:router@1.0.0', 'softwarerero:accounts-t9n@1.0.0', 'joshowens:simple-form@0.1.8'], ['client', 'server']); + api.use(['iron:router', 'softwarerero:accounts-t9n', 'joshowens:simple-form'], ['client', 'server']); // CLIENT api.use([ 'deps', @@ -89,7 +88,7 @@ Package.onTest(function (api) { 'coffeescript' ]); api.use(['iron:router', 'softwarerero:accounts-t9n', 'joshowens:simple-form'], ['client', 'server']); - api.use('joshowens:accounts-entry'); + api.use('vilango:accounts-entry'); api.addFiles(['tests/route.coffee', 'tests/client.html', 'tests/client.coffee'], 'client'); }); diff --git a/server/entry.coffee b/server/entry.coffee index fd467daf..55a312cd 100644 --- a/server/entry.coffee +++ b/server/entry.coffee @@ -30,4 +30,8 @@ Meteor.startup -> password: user.password profile: _.extend(profile, user.profile) if (user.email && Accounts._options.sendVerificationEmail) + @unblock() Accounts.sendVerificationEmail(userId, user.email) + + return userId + diff --git a/shared/router.coffee b/shared/router.coffee index be502403..c02bca71 100644 --- a/shared/router.coffee +++ b/shared/router.coffee @@ -69,8 +69,11 @@ Router.map -> path: '/sign-out' onBeforeAction: ()-> Session.set('entryError', undefined) - if AccountsEntry.settings.homeRoute - Meteor.logout () -> + Meteor.logout (error) -> + if error + console.error "logout failed", error + @next() + else Router.go AccountsEntry.settings.homeRoute @route 'entryResetPassword', @@ -88,5 +91,5 @@ _.each Router.routes, (route)-> Router.onStop -> # If the route is an entry route, no need to save it if Meteor.isClient - if (!_.contains(exclusions, Router.current().route.name)) - Session.set('fromWhere', Router.current().path) + if (!_.contains(exclusions, Router.current()?.route?.name)) + Session.set('fromWhere', Router.current().path) \ No newline at end of file From fa8604196f44a5a6dad04ce38bb86d9ea5203740 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 11 Jun 2015 18:11:44 +0200 Subject: [PATCH 11/15] bumped to version 1.0.3-3 --- .versions | 65 +++++++++++++ package.js | 10 +- versions.json | 251 -------------------------------------------------- 3 files changed, 72 insertions(+), 254 deletions(-) create mode 100644 .versions delete mode 100644 versions.json diff --git a/.versions b/.versions new file mode 100644 index 00000000..fb47077b --- /dev/null +++ b/.versions @@ -0,0 +1,65 @@ +accounts-base@1.2.0 +accounts-password@1.1.1 +base64@1.0.3 +binary-heap@1.0.3 +blaze@2.1.2 +blaze-tools@1.0.3 +boilerplate-generator@1.0.3 +callback-hook@1.0.3 +check@1.0.5 +coffeescript@1.0.6 +ddp@1.1.0 +deps@1.0.7 +ejson@1.0.6 +email@1.0.6 +geojson-utils@1.0.3 +handlebars@1.0.3 +html-tools@1.0.4 +htmljs@1.0.4 +id-map@1.0.3 +iron:controller@1.0.8 +iron:core@1.0.8 +iron:dynamic-template@1.0.8 +iron:layout@1.0.8 +iron:location@1.0.9 +iron:middleware-stack@1.0.9 +iron:router@1.0.9 +iron:url@1.0.9 +joshowens:simple-form@0.2.2 +jquery@1.11.3_2 +json@1.0.3 +less@1.0.14 +local-test:vilango:accounts-entry@1.0.3-3 +localstorage@1.0.3 +logging@1.0.7 +meteor@1.1.6 +minifiers@1.1.5 +minimongo@1.0.8 +mongo@1.1.0 +mongo-livedata@1.0.8 +mrt:underscore-string-latest@2.3.3 +npm-bcrypt@0.7.8_2 +observe-sequence@1.0.6 +ordered-dict@1.0.3 +random@1.0.3 +reactive-dict@1.1.0 +reactive-var@1.0.5 +retry@1.0.3 +routepolicy@1.0.5 +schnie:uploader@2.0.3 +service-configuration@1.0.4 +session@1.1.0 +sha@1.0.3 +softwarerero:accounts-t9n@1.1.1 +spacebars@1.0.6 +spacebars-compiler@1.0.6 +srp@1.0.3 +templating@1.1.1 +test-helpers@1.0.4 +tinytest@1.0.5 +tracker@1.0.7 +ui@1.0.6 +underscore@1.0.3 +vilango:accounts-entry@1.0.3-3 +webapp@1.2.0 +webapp-hashing@1.0.3 diff --git a/package.js b/package.js index 31e54378..27869895 100644 --- a/package.js +++ b/package.js @@ -1,13 +1,17 @@ Package.describe({ summary: "Make signin and signout their own pages with routes.", - version: '1.0.3-2', + version: '1.0.3-3', name: "vilango:accounts-entry" }); Package.onUse(function(api) { - api.versionsFrom("METEOR@0.9.0"); + api.versionsFrom("METEOR@0.9.2"); - api.use(['iron:router', 'softwarerero:accounts-t9n', 'joshowens:simple-form'], ['client', 'server']); + api.use([ + 'iron:router@1.0.9', + 'softwarerero:accounts-t9n@1.1.1', + 'joshowens:simple-form@0.2.2' + ], ['client', 'server']); // CLIENT api.use([ 'deps', diff --git a/versions.json b/versions.json deleted file mode 100644 index c659dff6..00000000 --- a/versions.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "dependencies": [ - [ - "accounts-base", - "1.1.2" - ], - [ - "accounts-password", - "1.0.4" - ], - [ - "application-configuration", - "1.0.3" - ], - [ - "base64", - "1.0.1" - ], - [ - "binary-heap", - "1.0.1" - ], - [ - "blaze", - "2.0.3" - ], - [ - "blaze-tools", - "1.0.1" - ], - [ - "boilerplate-generator", - "1.0.1" - ], - [ - "callback-hook", - "1.0.1" - ], - [ - "check", - "1.0.2" - ], - [ - "coffeescript", - "1.0.4" - ], - [ - "ddp", - "1.0.11" - ], - [ - "deps", - "1.0.5" - ], - [ - "ejson", - "1.0.4" - ], - [ - "email", - "1.0.4" - ], - [ - "follower-livedata", - "1.0.2" - ], - [ - "geojson-utils", - "1.0.1" - ], - [ - "handlebars", - "1.0.1" - ], - [ - "html-tools", - "1.0.2" - ], - [ - "htmljs", - "1.0.2" - ], - [ - "id-map", - "1.0.1" - ], - [ - "iron:controller", - "1.0.0" - ], - [ - "iron:core", - "1.0.0" - ], - [ - "iron:dynamic-template", - "1.0.0" - ], - [ - "iron:layout", - "1.0.0" - ], - [ - "iron:location", - "1.0.0" - ], - [ - "iron:middleware-stack", - "1.0.0" - ], - [ - "iron:router", - "1.0.0" - ], - [ - "iron:url", - "1.0.0" - ], - [ - "joshowens:simple-form", - "0.1.8" - ], - [ - "jquery", - "1.0.1" - ], - [ - "json", - "1.0.1" - ], - [ - "less", - "1.0.11" - ], - [ - "localstorage", - "1.0.1" - ], - [ - "logging", - "1.0.5" - ], - [ - "meteor", - "1.1.3" - ], - [ - "minifiers", - "1.1.2" - ], - [ - "minimongo", - "1.0.5" - ], - [ - "mongo", - "1.0.8" - ], - [ - "mrt:underscore-string-latest", - "2.3.3" - ], - [ - "npm-bcrypt", - "0.7.7" - ], - [ - "observe-sequence", - "1.0.3" - ], - [ - "ordered-dict", - "1.0.1" - ], - [ - "random", - "1.0.1" - ], - [ - "reactive-dict", - "1.0.4" - ], - [ - "reactive-var", - "1.0.3" - ], - [ - "retry", - "1.0.1" - ], - [ - "routepolicy", - "1.0.2" - ], - [ - "service-configuration", - "1.0.2" - ], - [ - "session", - "1.0.4" - ], - [ - "sha", - "1.0.1" - ], - [ - "softwarerero:accounts-t9n", - "1.0.0" - ], - [ - "spacebars", - "1.0.3" - ], - [ - "spacebars-compiler", - "1.0.3" - ], - [ - "srp", - "1.0.1" - ], - [ - "templating", - "1.0.9" - ], - [ - "tracker", - "1.0.3" - ], - [ - "ui", - "1.0.4" - ], - [ - "underscore", - "1.0.1" - ], - [ - "webapp", - "1.1.4" - ], - [ - "webapp-hashing", - "1.0.1" - ] - ], - "pluginDependencies": [], - "toolVersion": "meteor-tool@1.0.35", - "format": "1.0" -} \ No newline at end of file From e7bb75ce99ab1cf744ccc77862ee572aa6f5aa2c Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 11 Jun 2015 18:58:18 +0200 Subject: [PATCH 12/15] added Helper class to Helpers --- client/helpers.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/helpers.coffee b/client/helpers.coffee index 013a5b86..a0bb1743 100644 --- a/client/helpers.coffee +++ b/client/helpers.coffee @@ -37,4 +37,14 @@ UI.registerHelper 'passwordLoginService', -> !!Package['accounts-password'] UI.registerHelper 'showCreateAccountLink', -> - return !Accounts._options.forbidClientAccountCreation \ No newline at end of file + return !Accounts._options.forbidClientAccountCreation + + +class @Helper + @disableBtns = ($btns) -> + $btns.html($btns.html()+' ') + $btns.attr("disabled", "disabled") + + @enableBtns = ($btns) -> + $btns.html(s.strLeft($btns.html(),' ')) + $btns.attr("disabled", null) \ No newline at end of file From 5a76a83f2ef5bc4f31c0fd7f0857bfb4b347a0b6 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 11 Jun 2015 18:58:51 +0200 Subject: [PATCH 13/15] bumped version to 1.0.3-4 --- .versions | 4 ++-- package.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.versions b/.versions index fb47077b..7bff35c0 100644 --- a/.versions +++ b/.versions @@ -29,7 +29,7 @@ joshowens:simple-form@0.2.2 jquery@1.11.3_2 json@1.0.3 less@1.0.14 -local-test:vilango:accounts-entry@1.0.3-3 +local-test:vilango:accounts-entry@1.0.3-4 localstorage@1.0.3 logging@1.0.7 meteor@1.1.6 @@ -60,6 +60,6 @@ tinytest@1.0.5 tracker@1.0.7 ui@1.0.6 underscore@1.0.3 -vilango:accounts-entry@1.0.3-3 +vilango:accounts-entry@1.0.3-4 webapp@1.2.0 webapp-hashing@1.0.3 diff --git a/package.js b/package.js index 27869895..fdbd6948 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Make signin and signout their own pages with routes.", - version: '1.0.3-3', + version: '1.0.3-4', name: "vilango:accounts-entry" }); From 88b75d9cdce26a9ad340f056441e249a7afeae4e Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Thu, 11 Jun 2015 19:03:15 +0200 Subject: [PATCH 14/15] bumped version to 1.0.3-5 removed dependency to underscore string --- client/helpers.coffee | 2 +- package.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/helpers.coffee b/client/helpers.coffee index a0bb1743..8d9f594a 100644 --- a/client/helpers.coffee +++ b/client/helpers.coffee @@ -46,5 +46,5 @@ class @Helper $btns.attr("disabled", "disabled") @enableBtns = ($btns) -> - $btns.html(s.strLeft($btns.html(),' ')) + $btns.html(_.strLeft($btns.html(),' ')) $btns.attr("disabled", null) \ No newline at end of file diff --git a/package.js b/package.js index fdbd6948..e9cf857a 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Make signin and signout their own pages with routes.", - version: '1.0.3-4', + version: '1.0.3-5', name: "vilango:accounts-entry" }); From 4c9337ec5f46af22fca3bcd53b9a93aca32fd8a8 Mon Sep 17 00:00:00 2001 From: Gerwin Brunner Date: Mon, 15 Jun 2015 23:07:32 +0200 Subject: [PATCH 15/15] .version --- .versions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.versions b/.versions index 7bff35c0..dd355fb5 100644 --- a/.versions +++ b/.versions @@ -29,7 +29,7 @@ joshowens:simple-form@0.2.2 jquery@1.11.3_2 json@1.0.3 less@1.0.14 -local-test:vilango:accounts-entry@1.0.3-4 +local-test:vilango:accounts-entry@1.0.3-5 localstorage@1.0.3 logging@1.0.7 meteor@1.1.6 @@ -60,6 +60,6 @@ tinytest@1.0.5 tracker@1.0.7 ui@1.0.6 underscore@1.0.3 -vilango:accounts-entry@1.0.3-4 +vilango:accounts-entry@1.0.3-5 webapp@1.2.0 webapp-hashing@1.0.3