You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importRouterfrom'@koa/router'import{API_VERSION}from'./lib'import{posts}from'./controller'constprotectedRouter=newRouter({prefix: `/${API_VERSION}`})// Create post routeprotectedRouter.post('/posts',posts.createPost)// Delete post routeprotectedRouter.delete('/posts/:id',posts.deletePost)export{protectedRouter}
unprotectedRouter.ts
importRouterfrom'@koa/router'import{API_VERSION}from'./lib'import{general,posts,categories,tags,profile}from'./controller'constunprotectedRouter=newRouter({prefix: `/${API_VERSION}`})// Post list routeunprotectedRouter.get('/posts',posts.getPosts)// Post detail routeunprotectedRouter.get('/posts/:id',posts.getPost)// Categories routeunprotectedRouter.get('/categories',categories.getCategories)// Category detail routeunprotectedRouter.get('/categories/:slug',categories.getCategory)// Tags routeunprotectedRouter.get('/tags',tags.getTags)// Tag detail routeunprotectedRouter.get('/tags/:slug',tags.getTag)export{unprotectedRouter}
The text was updated successfully, but these errors were encountered:
Hi!
I don't know if there's something wrong with my code When I visit
localhost:4000/404
(a path that doesn't exist),koa-jwt
returns 401 error.If I use the
passthrough: true
option, I can't verify my identity.index.ts
protectedRouter.ts
unprotectedRouter.ts
The text was updated successfully, but these errors were encountered: