Do the guards work in real world?
Apr 8, 2023
2
Level 1
Testing when app has multiple guards
My app has multiple auth guards and there are different routes for each guard. I want to test that the route for one guard cannot be accessed by another guards. The one way to do this is to access the that route when logged into each guard and then assert the response. But I want to know if there's any other better way to do that.
Instead of testing every other guard access to that route, can I not test that only a intended guard can access that route.
Thanks in advance!
Please or to participate in this conversation.