woss
04/05/2018, 2:46 PMlawjolla
04/05/2018, 2:58 PMwoss
04/05/2018, 2:59 PMprisma init applawjolla
04/05/2018, 3:00 PMwoss
04/05/2018, 3:01 PMTypeError: Failed to fetch in terminal i see the error thrown nicely but it was not picked up by the server. now im looking at the source code trying to figure it out. it’s express under the hood 🙂lawjolla
04/05/2018, 3:02 PMwoss
04/05/2018, 3:02 PMlawjolla
04/05/2018, 3:45 PMlawjolla
04/05/2018, 3:45 PMwoss
04/05/2018, 3:46 PMwoss
04/05/2018, 3:50 PMError: invalid signature. I’m intentionally breaking the validity of a token. so that is not something that is unexpected. what’s unexpected is that it doesn’t handle the errors correctlywoss
04/05/2018, 3:53 PMlawjolla
04/05/2018, 3:58 PMwoss
04/05/2018, 3:59 PMlawjolla
04/05/2018, 3:59 PMlawjolla
04/05/2018, 4:00 PMwoss
04/05/2018, 4:01 PMwoss
04/05/2018, 4:01 PMlawjolla
04/05/2018, 4:02 PMlawjolla
04/05/2018, 4:02 PMwoss
04/05/2018, 4:03 PMlawjolla
04/05/2018, 4:03 PMlawjolla
04/05/2018, 4:04 PMwoss
04/05/2018, 4:05 PMwoss
04/05/2018, 4:05 PMlawjolla
04/05/2018, 4:05 PM<http://server.express.post|server.express.post>(
server.options.endpoint,
checkJwt,
(err, req, res, next) => {
if (err) return res.status(401).send(err.message)
next()
}
)woss
04/05/2018, 4:05 PMwoss
04/05/2018, 4:06 PMcheckJwt 99% same 😄lawjolla
04/05/2018, 4:13 PMwoss
04/05/2018, 4:15 PMprisma-binding would that make any difference if i would inclode it as well?lawjolla
04/05/2018, 4:16 PMwoss
04/05/2018, 4:23 PMlawjolla
04/05/2018, 4:25 PMerr should be returning something like..
...
name: 'UnauthorizedError',
message: 'jwt expired',
code: 'invalid_token',
status: 401,
...woss
04/05/2018, 4:26 PMlawjolla
04/05/2018, 4:27 PMwoss
04/05/2018, 4:27 PMwoss
04/05/2018, 4:28 PMlawjolla
04/05/2018, 4:28 PMlawjolla
04/05/2018, 4:29 PMlawjolla
04/05/2018, 4:31 PMwoss
04/05/2018, 4:33 PMlawjolla
04/05/2018, 4:35 PMlawjolla
04/05/2018, 4:37 PM<http://server.express.post|server.express.post>(
server.options.endpoint,
checkJwt,
(err, req, res, next) => {
if (err) req.user = { ... authorized: false}
next()
}
)woss
04/05/2018, 4:39 PMlawjolla
04/05/2018, 4:39 PMwoss
04/05/2018, 4:40 PM