Decoupled JWT from DB
This commit is contained in:
1 parent
14f6f05dfc
commit
0cc7751d2e
5 files changed
+16
-7
No files matched your search
@@ -166,11 +166,8 @@ const loginController = async (req, res, next) => {
|
||||
const logoutController = async (req, res, next) => {
|
||||
try {
|
||||
// Get user
|
||||
const { user } = req.body;
|
||||
const userToLogout = await req.db.getUserByEmail(
|
||||
{ body: { email: user.email } },
|
||||
res
|
||||
);
|
||||
const { email } = req.body;
|
||||
const userToLogout = await req.db.getUserByEmail({ body: { email } }, res);
|
||||
userToLogout.authToken = null;
|
||||
await userToLogout.save();
|
||||
|
||||
|
||||
Reference in new issue
Block a user