How can koa be verified using token jwt?

set to use token and url, that does not require verification to successfully return to the front end token using login

app.js
const jwtKoa = require("koa-jwt");
app.use(jwtKoa({secret}).unless({
    path: [/\/adduser/, /\/login/] //jwt
}))

but without path validation, the following function does not go at all, as I have seen in other articles. I don"t know where the problem

router.js
const routers = router
    .post("/product/list", user.list)

servse.js
const user = {
    async list (ctx) {
        console.log(ctx.headers.token, "ccccccccccc")
    }
}
May.22,2021

requires an Authorization:Bearer [token] field attached to the request header.


seems to be the order of app.use (). Do you call this in app.js? then try

.
app.use(jwtKoa({secret}).unless({
    path: [/\/adduser/, /\/login/] //jwt
}))

mention the front of all app.use ()


I have the same problem. The route is not going anywhere. How does the landlord handle it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32343-4ea5c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32343-4ea5c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?