                         else
                             Instance.resetKey = null
                             passwordKeys.resetKeys (err) ->
+
                                 if err? then next new Error err
                                 else
                                     passport.currentUser = null
                                     res.send 204
+
                 else
                     error = new Error validationErrors
                     error.status = 400
                     next error
+
             else
-                error = new Error "Key is invalid"
+                error = new Error polyglot.t "reset error invalid key"
                 error.status = 400
                 next error
 


module.exports.authenticated = (req, res) ->
    res.send 200, isAuthenticated: req.isAuthenticated()

        res.redirect '/'


module.exports.resetPassword = (req, res, next) ->
    key = req.params.key
    newPassword = req.body.password
    polyglot = localization.getPolyglot()

    User.first (err, user) ->

        if err? then next new Error err

        else if not user?
            err = new Error polyglot.t "reset error no user"
            err.status = 400
            err.headers = 'Location': '/register/'
            next err

        else

            if Instance.getResetKey() is req.params.key
                validationErrors = User.validatePassword newPassword

                if validationErrors.length is 0
                    data = password: helpers.cryptPassword(newPassword).hash
                    user.merge data, (err) ->
