mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-21 16:52:00 -07:00
Attach current user to context.user
This commit is contained in:
@@ -17,8 +17,8 @@ export async function ensureUser (ctx, next) {
|
||||
ctx.throw(401)
|
||||
}
|
||||
|
||||
const user = await User.findById(decoded.id, '-password')
|
||||
if (!user) {
|
||||
ctx.state.user = await User.findById(decoded.id, '-password')
|
||||
if (!ctx.state.user) {
|
||||
ctx.throw(401)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user