You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed theres a bit code repetition in your routers / handlers.
This pops up a few times:
if (req.headers.cookie){
let { jwt } = parse(req.headers.cookie)
verify(jwt, process.env.JWT_SECRET, (err, decoded)=>{
// some code here
}
And also the JWT verifying logic is split between the router/handler files. It might be more consistent to keep it to one or the other.
Another thing you could consider is having some reusable functions for things like bcrypt / JWTs (perhaps in a separate utils file), which you can pull in when needed... :)
The text was updated successfully, but these errors were encountered:
I noticed theres a bit code repetition in your routers / handlers.
This pops up a few times:
And also the JWT verifying logic is split between the router/handler files. It might be more consistent to keep it to one or the other.
Another thing you could consider is having some reusable functions for things like bcrypt / JWTs (perhaps in a separate
utils
file), which you can pull in when needed... :)The text was updated successfully, but these errors were encountered: