Reworking JWT authentication

This commit is contained in:
2021-07-28 21:36:04 +10:00
parent c63e14ddf3
commit 72b3babfd8
14 changed files with 27 additions and 18 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ const route = async (req, res) => {
//forcibly logout
tokens.destroy({
where: {
username: req.body.username || ''
email: req.body.email || ''
}
});
+1 -1
View File
@@ -12,7 +12,7 @@ router.use(tokenAuth);
router.use(async (req, res, next) => {
const record = await accounts.findOne({
where: {
username: req.user.username || ''
email: req.user.email || ''
}
});