1
0
mirror of https://github.com/fazo96/homework.git synced 2025-01-09 12:10:08 +01:00

further bug fixing

This commit is contained in:
Enrico Fasoli 2015-03-02 16:58:13 +01:00
parent 80c911d2a8
commit c567751331

View File

@ -77,7 +77,7 @@ guestController = RouteController.extend
else @render()
onBeforeAction: ->
if getUser()
if amIValid() is no then @redirect 'verifyEmail' else Router.redirect 'notes'
if amIValid() is no then @redirect 'verifyEmail' else @redirect 'notes'
@next()
# Page Routing
@ -91,7 +91,7 @@ Router.route '/',
onBeforeAction: ->
# Dispatch user to the right landing page based on his account status
if getUser()
if amIValid() is yes then @redirect 'notes' else Router.redirect 'verifyEmail'
if amIValid() is yes then @redirect 'notes' else @redirect 'verifyEmail'
@next()
Router.route '/login', controller: guestController
Router.route '/register', controller: guestController
@ -107,7 +107,7 @@ Router.route '/verify/:token?',
action: ->
if Meteor.status().connected is no
@render 'reconnect'
else @render()
else @render(); @render 'nothing', to: 'outside'
onBeforeAction: ->
if getUser()
if amIValid()
@ -123,6 +123,7 @@ Router.route '/verify/:token?',
showErr type:'success', msg:'Verification complete'
Router.go 'home'
@next()
@next()
else
@redirect 'home'
@next()