From eeaf2c379291ae19ef2f6caf6dba5e0a009565de Mon Sep 17 00:00:00 2001 From: Ryan Glover Date: Sat, 1 Nov 2014 11:00:43 -0500 Subject: [PATCH] Bump Iron Router to 1.0.0. Fix inconsistencies with previous version. --- .meteor/packages | 2 +- .meteor/versions | 12 ++++--- client/routes/filters.coffee | 6 ++-- client/routes/routes-authenticated.coffee | 13 ++++---- client/routes/routes-public.coffee | 55 ++++++++++++++++--------------- 5 files changed, 47 insertions(+), 41 deletions(-) diff --git a/.meteor/packages b/.meteor/packages index c5a8734..bae4079 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -13,7 +13,7 @@ check audit-argument-checks iron:router pinglamb:bootstrap3 -particle4dev:sass cmather:handlebars-server themeteorchef:jquery-validation +particle4dev:sass@0.3.0 diff --git a/.meteor/versions b/.meteor/versions index 48af59c..c16c66d 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -26,10 +26,14 @@ html-tools@1.0.2 htmljs@1.0.2 http@1.0.8 id-map@1.0.1 -iron:core@0.3.4 -iron:dynamic-template@0.4.1 -iron:layout@0.4.1 -iron:router@0.9.4 +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 jquery@1.0.1 json@1.0.1 launch-screen@1.0.0 diff --git a/client/routes/filters.coffee b/client/routes/filters.coffee index afb4785..d9d936c 100644 --- a/client/routes/filters.coffee +++ b/client/routes/filters.coffee @@ -13,7 +13,8 @@ checkUserLoggedIn = -> if not Meteor.loggingIn() and not Meteor.user() Router.go '/login' - @pause + else + @next() ### Filter: Check if a User Exists @@ -23,9 +24,10 @@ checkUserLoggedIn = -> userAuthenticated = -> if not Meteor.loggingIn() and Meteor.user() Router.go '/' + else + @next() # Run Filters - Router.onBeforeAction checkUserLoggedIn, except: [ 'signup', 'login', diff --git a/client/routes/routes-authenticated.coffee b/client/routes/routes-authenticated.coffee index 7e581d2..39f6f1f 100644 --- a/client/routes/routes-authenticated.coffee +++ b/client/routes/routes-authenticated.coffee @@ -1,8 +1,7 @@ -Router.map(-> - @route('index', - path: '/' - template: 'index' - onBeforeAction: -> - # Code to run before route goes here. - ) +Router.route('index', + path: '/' + template: 'index' + onBeforeAction: -> + # Code to run before route goes here. + @next() ) diff --git a/client/routes/routes-public.coffee b/client/routes/routes-public.coffee index 2f1dd9f..1659363 100644 --- a/client/routes/routes-public.coffee +++ b/client/routes/routes-public.coffee @@ -1,31 +1,32 @@ -Router.map(-> - - @route('signup', - path: '/signup' - template: 'signup' - onBeforeAction: -> - Session.set 'currentRoute', 'signup' - ) +Router.route('signup', + path: '/signup' + template: 'signup' + onBeforeAction: -> + Session.set 'currentRoute', 'signup' + @next() +) - @route('login', - path: '/login' - template: 'login' - onBeforeAction: -> - Session.set 'currentRoute', 'login' - ) +Router.route('login', + path: '/login' + template: 'login' + onBeforeAction: -> + Session.set 'currentRoute', 'login' + @next() +) - @route('recover-password', - path: '/recover-password' - template: 'recoverPassword' - onBeforeAction: -> - Session.set 'currentRoute', 'recover-password' - ) +Router.route('recover-password', + path: '/recover-password' + template: 'recoverPassword' + onBeforeAction: -> + Session.set 'currentRoute', 'recover-password' + @next() +) - @route('reset-password', - path: '/reset-password/:token' - template: 'resetPassword' - onBeforeAction: -> - Session.set 'currentRoute', 'reset-password' - Session.set 'resetPasswordToken', @params.token - ) +Router.route('reset-password', + path: '/reset-password/:token' + template: 'resetPassword' + onBeforeAction: -> + Session.set 'currentRoute', 'reset-password' + Session.set 'resetPasswordToken', @params.token + @next() ) -- 2.0.0