                     req.logIn user, {}, =>
                         @sendSuccess res, "Register succeeds."
 
+        user =
+            email: email
+            password: password
+            
         if @userManager.isValid user
             @userManager.all (err, users) =>
                 if err

                else
                    createUser()
        else
            @sendError res, @userManager.error

    # Send an email with a temporary key that allows acceess to
    # a change password page.
    forgotPasswordAction: (req, res) =>

        sendEmail = (instances) =>
            if instances.length > 0
                instance = instances[0].value
            else

                        console.log err
                        @sendError res, "Server error occured.", 500
                    else
                        sendEmail instances, user, key

    # Display reset password view, only if given key is valid.
    resetPasswordView: (req, res) =>
