Skip to content
This repository was archived by the owner on Nov 10, 2021. It is now read-only.

Commit 809dd66

Browse files
committed
Fix revoked token access passed
1 parent ede34a2 commit 809dd66

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ router
109109
// Token should be "Authorization: Bearer <UUID>"
110110
const token = auth.replace(/^Bearer /, "")
111111
// Authentication (token to user)
112-
await knex("users").first("id").where("token", token)
112+
await knex("users").first("id").where({token, revoked: false})
113113
.then(user => {
114114
ctx.assert(user, 403)
115115
ctx.user = user.id
@@ -154,7 +154,6 @@ router
154154
})
155155
})
156156

157-
158157
// Run API Server
159158
app
160159
.use(async (ctx, next) => {

0 commit comments

Comments
 (0)