         @render @params.action
 
     # session
-    @route 'signup',
-      onBeforeAction: (pause) ->
-        if Meteor.userId()?
-          FlashMessages.sendWarning 'Du er allerede logget ind'
-          @redirect 'lobby'
-          pause()
+    @route 'login'
 
-    @route 'login',
-      onBeforeAction: (pause) ->
-        if Meteor.userId()?
-          FlashMessages.sendWarning 'Du er allerede logget ind'
-          @redirect 'lobby'
-          pause()
+    @route 'signup'
 
     @route 'logout',
-      onBeforeAction: (pause) ->
-        unless Meteor.userId()?
-          FlashMessages.sendError 'Du er ikke logget ind'
-          @redirect 'login'
-          pause()
-
       action: ->
         id = Meteor.userId()
 


      # redirect user to where he came from
      if loginRedirect and loginRedirect != 'logout'
        console.log "Redirecting"
        Session.set loginRedirectKey, null
        @redirect loginRedirect
        pause()

  , { except: ['login', 'logout', 'signup', 'game', 'highscores'] }

  Router.map ->
    # lobby


        # Check that the quiz has started and hasn't run out
        now = new Date()
        unless (quiz.startDate < now and now < quiz.endDate)
          @render 'notAvailable'
          pause()
          return
