Commit c74fde23d11245b650db36ddad31c10619c40368

Authored by Ryan Glover
Exists in master

Merge branch 'refactor/update_iron_router'

... ... @@ -13,7 +13,7 @@ check
13 13 audit-argument-checks
14 14 iron:router
15 15 pinglamb:bootstrap3
16   -particle4dev:sass
17 16 cmather:handlebars-server
18 17 themeteorchef:jquery-validation
  18 +particle4dev:sass@0.3.0
19 19  
... ...
... ... @@ -26,10 +26,14 @@ html-tools@1.0.2
26 26 htmljs@1.0.2
27 27 http@1.0.8
28 28 id-map@1.0.1
29   -iron:core@0.3.4
30   -iron:dynamic-template@0.4.1
31   -iron:layout@0.4.1
32   -iron:router@0.9.4
  29 +iron:controller@1.0.0
  30 +iron:core@1.0.0
  31 +iron:dynamic-template@1.0.0
  32 +iron:layout@1.0.0
  33 +iron:location@1.0.0
  34 +iron:middleware-stack@1.0.0
  35 +iron:router@1.0.0
  36 +iron:url@1.0.0
33 37 jquery@1.0.1
34 38 json@1.0.1
35 39 launch-screen@1.0.0
... ...
client/routes/filters.coffee
... ... @@ -13,7 +13,8 @@
13 13 checkUserLoggedIn = ->
14 14 if not Meteor.loggingIn() and not Meteor.user()
15 15 Router.go '/login'
16   - @pause
  16 + else
  17 + @next()
17 18  
18 19 ###
19 20 Filter: Check if a User Exists
... ... @@ -23,9 +24,10 @@ checkUserLoggedIn = ->
23 24 userAuthenticated = ->
24 25 if not Meteor.loggingIn() and Meteor.user()
25 26 Router.go '/'
  27 + else
  28 + @next()
26 29  
27 30 # Run Filters
28   -
29 31 Router.onBeforeAction checkUserLoggedIn, except: [
30 32 'signup',
31 33 'login',
... ...
client/routes/routes-authenticated.coffee
1   -Router.map(->
2   - @route('index',
3   - path: '/'
4   - template: 'index'
5   - onBeforeAction: ->
6   - # Code to run before route goes here.
7   - )
  1 +Router.route('index',
  2 + path: '/'
  3 + template: 'index'
  4 + onBeforeAction: ->
  5 + # Code to run before route goes here.
  6 + @next()
8 7 )
... ...
client/routes/routes-public.coffee
1   -Router.map(->
2   -
3   - @route('signup',
4   - path: '/signup'
5   - template: 'signup'
6   - onBeforeAction: ->
7   - Session.set 'currentRoute', 'signup'
8   - )
  1 +Router.route('signup',
  2 + path: '/signup'
  3 + template: 'signup'
  4 + onBeforeAction: ->
  5 + Session.set 'currentRoute', 'signup'
  6 + @next()
  7 +)
9 8  
10   - @route('login',
11   - path: '/login'
12   - template: 'login'
13   - onBeforeAction: ->
14   - Session.set 'currentRoute', 'login'
15   - )
  9 +Router.route('login',
  10 + path: '/login'
  11 + template: 'login'
  12 + onBeforeAction: ->
  13 + Session.set 'currentRoute', 'login'
  14 + @next()
  15 +)
16 16  
17   - @route('recover-password',
18   - path: '/recover-password'
19   - template: 'recoverPassword'
20   - onBeforeAction: ->
21   - Session.set 'currentRoute', 'recover-password'
22   - )
  17 +Router.route('recover-password',
  18 + path: '/recover-password'
  19 + template: 'recoverPassword'
  20 + onBeforeAction: ->
  21 + Session.set 'currentRoute', 'recover-password'
  22 + @next()
  23 +)
23 24  
24   - @route('reset-password',
25   - path: '/reset-password/:token'
26   - template: 'resetPassword'
27   - onBeforeAction: ->
28   - Session.set 'currentRoute', 'reset-password'
29   - Session.set 'resetPasswordToken', @params.token
30   - )
  25 +Router.route('reset-password',
  26 + path: '/reset-password/:token'
  27 + template: 'resetPassword'
  28 + onBeforeAction: ->
  29 + Session.set 'currentRoute', 'reset-password'
  30 + Session.set 'resetPasswordToken', @params.token
  31 + @next()
31 32 )
... ...