여유상점_0911 : 7) Admin_Client.js:10 POST http://localhost:3100/admin/findPw net::ERR_CONNECTION_RESET (anonymous) @ Admin_Client.js:10 TypeError: Failed to fetch

오범준·2020년 9월 11일
0

Solution

Usually this problem is related with response sent from the backend

// Step 3 : send the email
transporter.sendMail(mailOption, (err,data) => {
if(err){
console.log("error :", err)
return res.status(404).json({message : 'Nodemailer Error'})
}else{
console.log("Email sent complete")
return res.status(200).json({ message : 'success', email : PswEmail})
}
})

return res.status(200).json({ message : 'success', email : PswEmail})

Autaully, there was no 'PswEmail' in the backend code,
that is, server is sending no-existing info,

So even if, the request from the frontend using the fetch api succeed, the response is not valid from the backend, and response is not handled properly in the frontend

profile
Dream of being "물빵개" ( Go abroad for Dance and Programming)

0개의 댓글