From 20f451c09847ef8d54f5499833450471aef4aabb Mon Sep 17 00:00:00 2001 From: vhmh2005 Date: Tue, 24 Mar 2015 09:45:54 +0700 Subject: [PATCH 01/14] fix iron router error: route never dispatch in case Meteor.loggingIn() is true --- client/entry.coffee | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/entry.coffee b/client/entry.coffee index 2efa7c0d..e89ed829 100644 --- a/client/entry.coffee +++ b/client/entry.coffee @@ -30,13 +30,12 @@ AccountsEntry = signInRequired: (router, extraCondition) -> extraCondition ?= true unless Meteor.loggingIn() - if Meteor.user() and extraCondition - router.next() - else + if not (Meteor.user() and extraCondition) Session.set('fromWhere', router.url) Router.go('/sign-in') Session.set('entryError', t9n('error.signInRequired')) - router.next() + router.next() + @AccountsEntry = AccountsEntry From 0c4692ba01f7251183f0df0445ae31622072d582 Mon Sep 17 00:00:00 2001 From: vhmh2005 Date: Thu, 30 Apr 2015 16:19:53 +0700 Subject: [PATCH 02/14] use text link with Box and Onedrive --- client/entry.less | 5 +++++ client/helpers.coffee | 9 ++++++--- client/views/social/social.html | 24 +++++++++++++++++------- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/client/entry.less b/client/entry.less index fe0dbd7a..322746e5 100644 --- a/client/entry.less +++ b/client/entry.less @@ -100,6 +100,11 @@ } } } + + a { + display: block; + margin: auto; + } } .email-option { diff --git a/client/helpers.coffee b/client/helpers.coffee index 3b4f8612..6de978db 100644 --- a/client/helpers.coffee +++ b/client/helpers.coffee @@ -28,7 +28,7 @@ UI.registerHelper 'otherLoginServices', -> Accounts.oauth.serviceNames().length > 0 UI.registerHelper 'loginServices', -> - Accounts.oauth.serviceNames() + ["google", "dropbox", "box", "onedrive"] UI.registerHelper 'showSignupCode', -> AccountsEntry.settings.showSignupCode is true @@ -50,9 +50,12 @@ UI.registerHelper 'containerCSSClass', -> "container-fluid" else "container" - + UI.registerHelper 'rowCSSClass', -> if AccountsEntry.settings.fluidLayout is true "row-fluid" else - "row" \ No newline at end of file + "row" + +UI.registerHelper 'isPrimaryService', (serviceName)-> + serviceName is 'google' or serviceName is 'dropbox' diff --git a/client/views/social/social.html b/client/views/social/social.html index f3732887..4ecf87df 100644 --- a/client/views/social/social.html +++ b/client/views/social/social.html @@ -1,9 +1,19 @@ From 8c28f2c610fa348f0cd6cf5babafc03149b51530 Mon Sep 17 00:00:00 2001 From: vhmh2005 Date: Tue, 2 Jun 2015 14:58:37 +0700 Subject: [PATCH 03/14] Hotfix problem of login loop when login from multiple tabs --- shared/router.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/router.coffee b/shared/router.coffee index 9a2e92ce..9f28ed35 100644 --- a/shared/router.coffee +++ b/shared/router.coffee @@ -7,7 +7,7 @@ Router.map -> Session.set('buttonText', 'in') @next() onRun: -> - if Meteor.userId() + if Meteor.user() Router.go AccountsEntry.settings.dashboardRoute if AccountsEntry.settings.signInTemplate From 2fd9309f7e4c27f1cfa426dcf570f7b234657173 Mon Sep 17 00:00:00 2001 From: Hao Tang Date: Fri, 3 Jul 2015 10:26:40 +0700 Subject: [PATCH 04/14] Fix Inconsistent password validation for 2 cases --- client/t9n/english.coffee | 2 +- client/views/signUp/signUp.coffee | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/client/t9n/english.coffee b/client/t9n/english.coffee index 6181f772..282d54e8 100644 --- a/client/t9n/english.coffee +++ b/client/t9n/english.coffee @@ -30,7 +30,7 @@ en = "User not found": "User not found" error: - minChar: "7 character minimum password." + minChar: "6 character minimum password." pwOneLetter: "Password requires 1 letter." pwOneDigit: "Password must have at least one digit." usernameRequired: "Username is required." diff --git a/client/views/signUp/signUp.coffee b/client/views/signUp/signUp.coffee index 8eb32bc8..e14aef31 100644 --- a/client/views/signUp/signUp.coffee +++ b/client/views/signUp/signUp.coffee @@ -83,15 +83,31 @@ AccountsEntry.entrySignUpEvents = { fields = AccountsEntry.settings.passwordSignupFields +# passwordErrors = do (password)-> +# errMsg = [] +# msg = false +# if password.length < 7 +# errMsg.push t9n("error.minChar") +# if password.search(/[a-z]/i) < 0 +# errMsg.push t9n("error.pwOneLetter") +# if password.search(/[0-9]/) < 0 +# errMsg.push t9n("error.pwOneDigit") +# +# if errMsg.length > 0 +# msg = "" +# errMsg.forEach (e) -> +# msg = msg.concat "#{e}\r\n" +# +# Session.set 'entryError', msg +# return true +# +# return false + passwordErrors = do (password)-> errMsg = [] msg = false - if password.length < 7 + if password.length < 6 errMsg.push t9n("error.minChar") - if password.search(/[a-z]/i) < 0 - errMsg.push t9n("error.pwOneLetter") - if password.search(/[0-9]/) < 0 - errMsg.push t9n("error.pwOneDigit") if errMsg.length > 0 msg = "" From 0ffbce7414a10978061b5e94857bffdfad69eb96 Mon Sep 17 00:00:00 2001 From: Hao Tang Date: Fri, 3 Jul 2015 14:00:29 +0700 Subject: [PATCH 05/14] Fix User can an access sign-up page after sign-up --- shared/router.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shared/router.coffee b/shared/router.coffee index 9f28ed35..cf33661f 100644 --- a/shared/router.coffee +++ b/shared/router.coffee @@ -3,6 +3,8 @@ Router.map -> @route "entrySignIn", path: "/sign-in" onBeforeAction: -> + if Meteor.user() + Router.go AccountsEntry.settings.dashboardRoute Session.set('entryError', undefined) Session.set('buttonText', 'in') @next() @@ -34,6 +36,8 @@ Router.map -> @route "entrySignUp", path: "/sign-up" onBeforeAction: -> + if Meteor.user() + Router.go AccountsEntry.settings.dashboardRoute Session.set('entryError', undefined) Session.set('buttonText', 'up') @next() @@ -62,6 +66,8 @@ Router.map -> @route "entryForgotPassword", path: "/forgot-password" onBeforeAction: -> + if Meteor.user() + Router.go AccountsEntry.settings.dashboardRoute Session.set('entryError', undefined) @next() @@ -78,6 +84,8 @@ Router.map -> @route 'entryResetPassword', path: 'reset-password/:resetToken' onBeforeAction: -> + if Meteor.user() + Router.go AccountsEntry.settings.dashboardRoute Session.set('entryError', undefined) Session.set('resetToken', @params.resetToken) @next() From e1b799f653209e5dfafd2c6cae3498d9803db471 Mon Sep 17 00:00:00 2001 From: vhmh2005 Date: Mon, 6 Jul 2015 09:57:16 +0700 Subject: [PATCH 06/14] Modify account-entry package --- client/entry.less | 9 --- client/views/signIn/signIn.html | 99 ++++++++++++++++++++------------- client/views/social/social.html | 14 +---- 3 files changed, 63 insertions(+), 59 deletions(-) diff --git a/client/entry.less b/client/entry.less index 322746e5..d4e7a621 100644 --- a/client/entry.less +++ b/client/entry.less @@ -82,15 +82,6 @@ } } - &#entry-google { - background: #db5a3c; - color: #fff; - - &:hover { - background: #CA4C2E; - } - } - &#entry-github { background: #666; color: #fff; diff --git a/client/views/signIn/signIn.html b/client/views/signIn/signIn.html index 8b72eec0..999cc7b7 100644 --- a/client/views/signIn/signIn.html +++ b/client/views/signIn/signIn.html @@ -1,47 +1,70 @@