     authenticatedAction: (req, res) =>
         res.send success: req.isAuthenticated()
 
+    # Check user credentials and keep user authentication through session.
     authenticate: (req, res) =>
-        # Check user credentials and keep user authentication through session.
         answer = (err) =>
             if err
                 @sendError res, "Login failed"

                    else
                        req.logIn user, {}, answer

        authenticator(req, res)


    loginAction: (req, res) =>
        req.body.username = "owner"
        @authenticate(req, res)

    # Clear authentication credentials from session for current user.
    logoutAction: (req, res) =>

    loginView: (req, res) =>
        @userManager.all (err, users) =>
            if users?.length > 0 and not err
                name = helpers.hideEmail users[0].value.email
                if name?
                    name = name.charAt(0).toUpperCase() + name.slice(1)
                res.render 'login', username: name
            else
                res.redirect 'register'

