diff --git a/client/entry.coffee b/client/entry.coffee index 1274e738..b3914202 100644 --- a/client/entry.coffee +++ b/client/entry.coffee @@ -42,6 +42,12 @@ AccountsEntry = Session.set('entryError', t9n('error.signInRequired')) router.next() + dashboardRoute: -> + if 'function' is typeof @settings.dashboardRoute + @settings.dashboardRoute() + else + @settings.dashboardRoute + @AccountsEntry = AccountsEntry diff --git a/client/views/enrollAccount/enrollAccount.coffee b/client/views/enrollAccount/enrollAccount.coffee index 1e5bc725..407b2472 100644 --- a/client/views/enrollAccount/enrollAccount.coffee +++ b/client/views/enrollAccount/enrollAccount.coffee @@ -37,4 +37,4 @@ Template.entryEnrollAccount.events Session.set('entryError', (error.reason || "Unknown error")) else Session.set('resetToken', null) - Router.go AccountsEntry.settings.dashboardRoute + Router.go AccountsEntry.dashboardRoute() diff --git a/client/views/resetPassword/resetPassword.coffee b/client/views/resetPassword/resetPassword.coffee index 352a0225..d1d665ff 100644 --- a/client/views/resetPassword/resetPassword.coffee +++ b/client/views/resetPassword/resetPassword.coffee @@ -39,4 +39,4 @@ Template.entryResetPassword.events Session.set('entryError', (error.reason || "Unknown error")) else Session.set('resetToken', null) - Router.go AccountsEntry.settings.dashboardRoute + Router.go AccountsEntry.dashboardRoute() diff --git a/client/views/signIn/signIn.coffee b/client/views/signIn/signIn.coffee index 8abf60a1..ffaa0b01 100644 --- a/client/views/signIn/signIn.coffee +++ b/client/views/signIn/signIn.coffee @@ -48,7 +48,7 @@ AccountsEntry.entrySignInEvents = { Router.go Session.get('fromWhere') Session.set('fromWhere', undefined) else - Router.go AccountsEntry.settings.dashboardRoute + Router.go AccountsEntry.dashboardRoute() ) } diff --git a/client/views/signUp/signUp.coffee b/client/views/signUp/signUp.coffee index 77c47a58..c54f23c8 100644 --- a/client/views/signUp/signUp.coffee +++ b/client/views/signUp/signUp.coffee @@ -163,7 +163,7 @@ AccountsEntry.entrySignUpEvents = { Router.go Session.get('fromWhere') Session.set 'fromWhere', undefined else - Router.go AccountsEntry.settings.dashboardRoute + Router.go AccountsEntry.dashboardRoute() else if AccountsEntry.settings.emailVerificationPendingRoute diff --git a/client/views/social/social.coffee b/client/views/social/social.coffee index f51b49d6..620812d2 100644 --- a/client/views/social/social.coffee +++ b/client/views/social/social.coffee @@ -33,7 +33,7 @@ Template.entrySocial.events Router.go Session.get('fromWhere') Session.set('fromWhere', undefined) else - Router.go AccountsEntry.settings.dashboardRoute + Router.go AccountsEntry.dashboardRoute() else if (err instanceof Accounts.LoginCancelledError) # do nothing else if (err instanceof ServiceConfiguration.ConfigError) diff --git a/shared/router.coffee b/shared/router.coffee index e0bc228b..65d57c4d 100644 --- a/shared/router.coffee +++ b/shared/router.coffee @@ -8,7 +8,7 @@ Router.map -> @next() onRun: -> if Meteor.userId() - Router.go AccountsEntry.settings.dashboardRoute + Router.go AccountsEntry.dashboardRoute() if AccountsEntry.settings.signInTemplate @template = AccountsEntry.settings.signInTemplate