Baixei o projeto da aula 3, mas as rotas que usam o token para autenticar está dando o erro abaixo, as rotas de criar usuário e login estão funcionando.
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
App listening on port 3000
(node:11964) UnhandledPromiseRejectionWarning: ReferenceError: InvalidArgumentError is not defined
at adiciona (C:\Users\switek\Desktop\blog-do-codigo-aula-3\src\posts\posts-controlador.js:11:27)
at Layer.handle [as handle_request] (C:\Users\switek\Desktop\blog-do-codigo-aula-3\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Users\switek\Desktop\blog-do-codigo-aula-3\node_modules\express\lib\router\route.js:137:13)
at C:\Users\switek\Desktop\blog-do-codigo-aula-3\src\usuarios\middlewares-autenticacao.js:45:16
at Strategy.strategy.success (C:\Users\switek\Desktop\blog-do-codigo-aula-3\node_modules\passport\lib\middleware\authenticate.js:219:18)
at verified (C:\Users\switek\Desktop\blog-do-codigo-aula-3\node_modules\passport-http-bearer\lib\strategy.js:126:10)
at Strategy._verify (C:\Users\switek\Desktop\blog-do-codigo-aula-3\src\usuarios\estrategias-autenticacao.js:52:9)
(node:11964) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11964) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.