Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fake-auth doesn't work when route-level middleware is applied #6

Open
Altai-man opened this issue Nov 24, 2019 · 1 comment
Open

fake-auth doesn't work when route-level middleware is applied #6

Altai-man opened this issue Nov 24, 2019 · 1 comment

Comments

@Altai-man
Copy link
Member

It works with server-side before middleware, because server-side ones are omitted...
But when route-level one silently "overwrites" fake-auth, it might be confusing to the user. If not fix, can't we at least raise a warning in this case, saying that "Try to apply your middleware on server-level"?

@jnthn
Copy link
Member

jnthn commented Nov 24, 2019

But when route-level one silently "overwrites" fake-auth, it might be confusing to the user. If not fix, can't we at least raise a warning in this case

Not sure how we'd be able to detect this situation. Also, one might actually want to test the auth logic too, so we don't really want to rule out that possibility. Probably it's worth updating the documentation for fake-auth to note this case, however.

saying that "Try to apply your middleware on server-level"?

There's no need to apply the auth middleware on the server level; just write a route block with the routes to test, and include it into one adding the auth middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants