TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:37:20)
    at Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at new NodeError (node:internal/errors:393:5)
    at ServerResponse.end (node:_http_outgoing:929:15)
    at ServerResponse.end (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/compiled/compression/index.js:22:783)
    at apiRes.end (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:347:25)
    at Object.sendError (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/index.js:115:9)
    at Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:381:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
Emitted 'error' event on ServerResponse instance at:
    at emitErrorNt (node:_http_outgoing:790:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'ERR_STREAM_WRITE_AFTER_END'
}

Node.js v18.9.1
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/notification.js:44:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
TypeError: Cannot read properties of undefined (reading 'status')
    at handler (/home/fmajelgo/public_html/dashboard.iotacademy.ir/.next/server/pages/api/auth/login.js:46:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/api-utils/node.js:363:9)
    at async NextNodeServer.runApi (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:487:9)
    at async Object.fn (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/next-server.js:749:37)
    at async Router.execute (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/router.js:253:36)
    at async NextNodeServer.run (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/home/fmajelgo/nodevenv/public_html/dashboard.iotacademy.ir/18/lib/node_modules/next/dist/server/base-server.js:322:20)
