mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
return token decoded
This commit is contained in:
parent
1cfe25f2f8
commit
4b9cf0baa6
@ -10,7 +10,8 @@ export default {
|
|||||||
|
|
||||||
let result = {
|
let result = {
|
||||||
expired: false,
|
expired: false,
|
||||||
valid: true
|
valid: true,
|
||||||
|
session: null
|
||||||
}
|
}
|
||||||
|
|
||||||
await jwt.verify(token, global.jwtStrategy.secretOrKey, async (err, decoded) => {
|
await jwt.verify(token, global.jwtStrategy.secretOrKey, async (err, decoded) => {
|
||||||
@ -42,6 +43,10 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (result.valid) {
|
||||||
|
result.session = await jwt.decode(token)
|
||||||
|
}
|
||||||
|
|
||||||
return res.json(result)
|
return res.json(result)
|
||||||
},
|
},
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user