         $("##{idSignup}").removeClass('active')
         $("#signin-email").focus()
         # Display form corresponding to tab
-        Session.set("loginForm", "signin")
+        Session.set("isInSignupMode", false)
       "click #login-signup-tab": ->
-        if Session.get("loginForm") == "signup"
+        if Session.get("isInSignupMode")
           return
 
         $("##{idSignup}").addClass('active')
         $("##{idSignIn}").removeClass('active')
         $("#signup-email").focus()
         logger.debug("Showing signup form")
-        Session.set("loginForm", "signup")
+        Session.set("isInSignupMode", true)
       ,
       'submit #signin-form': (e, t) ->
         e.preventDefault()

  return t.find('.account-password').value

class @LoginService
  constructor: ->
    Session.set("loginForm", "signin")

  setupTemplate: ->
    Template.login.helpers({
      showSignIn: ->
        return Session.get("loginForm") == "signin"
      ,
      showSignUp: ->
        return Session.get("loginForm") == "signup"
      ,
    })
    Template.login.events({
      "click #login-signin-tab": ->
        if Session.get("loginForm") == "signin"
          return

        logger.debug("Showing signin form")

            logger.warn("Couldn't register user: #{err}")
        )

        Session.set("isInSignupMode", false)
        false
      ,
    })
    Template.forgotPassword.helpers({
