PacktPublishing / Accelerating-Server-Side-Development-with-Fastify

Accelerate Web Development with Fastify, published by Packt
MIT License
128 stars 37 forks source link

Chapter 3 - impossible to succeed with an excercise #56

Closed freiondrej-lokalise closed 1 year ago

freiondrej-lokalise commented 1 year ago

In managing-the-routes-scope-nested.cjs, the parseUserHook() sets isAdmin: true if level is 42. However, level99Hook() needs a level higher than 99, thus it's never possible to reach /onlyAdmin successfully. Or am I missing something?

So maybe the condition in parseUserHook could be changed to e.g. level === 100 so that it's possible to satisfy both conditions :)

Eomm commented 1 year ago

You don't miss anything! That's an error for sure! Thanks for the report!