joshuaslate/mern-starter

Error while trying forgot password

Closed this issue · 0 comments

error in console:
`mern-auth\server\node_modules\mongoose\node_modules\mongodb\lib\utils.js:98
process.nextTick(function() { throw err; });
^

TypeError: Request path contains unescaped characters.
at new ClientRequest (http_client.js:50:11)
at Object.exports.request (http.js:31:10)
at Object.socket.once.exports.request (https.js:182:15)
at Object.request (C:\mern-auth\server\node_modules\mailgun-js\node_modules\proxy-agent\node_modules\agent-base\patch-core.js:52:20)
at Request.performRequest (C:\mern-auth\server\node_modules\mailgun-js\lib\request.js:340:19)
at Request.request (C:\mern-auth\server\node_modules\mailgun-js\lib\request.js:110:10)
at Mailgun.request (C:\mern-auth\server\node_modules\mailgun-js\lib\mailgun.js:71:14)
at constructor.(anonymous function) as send
at Object.exports.sendEmail (C:\mern-auth\server\config\mailgun.js:14:24)
at C:\mern-auth\server\controllers\authentication.js:150:19
at model. (C:\mern-auth\server\node_modules\mongoose\lib\document.js:1894:20)
at next
(C:\mern-auth\server\node_modules\mongoose\node_modules\hooks-fixed\hooks.js:89:34)
at fnWrapper (C:\mern-auth\server\node_modules\mongoose\node_modules\hooks-fixed\hooks.js:186:18)
at C:\mern-auth\server\node_modules\mongoose\lib\model.js:3343:16
at C:\mern-auth\server\node_modules\mongoose\lib\model.js:228:5
at C:\mern-auth\server\node_modules\mongoose\lib\model.js:166:9
at handleCallback (C:\mern-auth\server\node_modules\mongoose\node_modules\mongodb\lib\utils.js:96:12)
at C:\mern-auth\server\node_modules\mongoose\node_modules\mongodb\lib\collection.js:1010:5
at commandCallback (C:\mern-auth\server\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:1194:9)
at Callbacks.emit (C:\mern-auth\server\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:119:3)
at null.messageHandler (C:\mern-auth\server\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:358:23)
at Socket. (C:\mern-auth\server\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\connection\connection.js:292:22)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:153:18)
at Socket.Readable.push (_stream_readable.js:111:10)
at TCP.onread (net.js:531:20)
[nodemon] app crashed - waiting for file changes before starting...`

error in Chrome console:

bundle.js:31950 Uncaught (in promise) TypeError: Cannot read property 'error' of undefined
at http://localhost:8080/bundle.js:31950:50

`function getForgotPasswordToken(_ref3) {
var email = _ref3.email;

  return function (dispatch) {
    _axios2.default.post(API_URL + '/auth/forgot-password', { email: email }).then(function (response) {
      dispatch({
        type: _types.FORGOT_PASSWORD_REQUEST,
        payload: response.data.message
      });
    }).catch(function (response) {
      return dispatch(errorHandler(response.data.error));
    });
  };
}`