Closed werepa closed 7 years ago
Sorry, i do't known what's the meaning of ”protect“? Disable, invisible or other meanings. Can you offer more detail of protect's behavior? Thank you!
Thanks for listening. I would like to define security routes (JWT, for example). Before I used the following code for this:
app.use(koaJwt({ secret: 'secr3t' }).unless({ path: [/^\/public|] })); // this is not working together with koa-oai-router.
I would like the code to execute a function to check if the user is allowed to access that route.
I found my mistake:
app.use(koaJwt({ secret: 'secr3t' }).unless({ path: [/^\/public|^\/docs-v3|^\/koa-oai-router-v3/] }));
This code fix it.
Ok, that's good.
How can I protect a specific route using koa-oai-router?