DEV Community

Discussion on: Should routing go before security?

Collapse
 
jawil003 profile image
Jannik

I think your colleague is right, but I think it is a small security issue because you may can evaluate which routes exist but not seem like a big issue to me. At the end both works if you design your Frontend in a way that fits.

Collapse
 
rytis profile image
Rytis

My thoughts exactly on the security. Even though security through obscurity is not a good practice, if we return 401 for all unauthenticated requests, then we're hiding which routes exist if the user is not authenticated.

Collapse
 
jawil003 profile image
Jannik

Yeah on a security aspect it makes totally sense.