(no title)
weavejester | 4 months ago
You use `req.cookies['token']` as an example of a subtle bug in JavaScript, but this isn't necessarily an inherent bug to dynamic typing in general. You could, for example, have a key lookup function that requires you to pass in a default value, or callback to handle what occurs if the value is missing.
req.cookies.get('token', () => {
throw new AuthFailure("Missing token")
})
No comments yet.