1
0
mirror of https://github.com/fazo96/homework.git synced 2025-01-10 12:14:22 +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() else @render()
onBeforeAction: -> onBeforeAction: ->
if getUser() if getUser()
if amIValid() is no then @redirect 'verifyEmail' else Router.redirect 'notes' if amIValid() is no then @redirect 'verifyEmail' else @redirect 'notes'
@next() @next()
# Page Routing # Page Routing
@ -91,7 +91,7 @@ Router.route '/',
onBeforeAction: -> onBeforeAction: ->
# Dispatch user to the right landing page based on his account status # Dispatch user to the right landing page based on his account status
if getUser() if getUser()
if amIValid() is yes then @redirect 'notes' else Router.redirect 'verifyEmail' if amIValid() is yes then @redirect 'notes' else @redirect 'verifyEmail'
@next() @next()
Router.route '/login', controller: guestController Router.route '/login', controller: guestController
Router.route '/register', controller: guestController Router.route '/register', controller: guestController
@ -107,7 +107,7 @@ Router.route '/verify/:token?',
action: -> action: ->
if Meteor.status().connected is no if Meteor.status().connected is no
@render 'reconnect' @render 'reconnect'
else @render() else @render(); @render 'nothing', to: 'outside'
onBeforeAction: -> onBeforeAction: ->
if getUser() if getUser()
if amIValid() if amIValid()
@ -123,6 +123,7 @@ Router.route '/verify/:token?',
showErr type:'success', msg:'Verification complete' showErr type:'success', msg:'Verification complete'
Router.go 'home' Router.go 'home'
@next() @next()
@next()
else else
@redirect 'home' @redirect 'home'
@next() @next()