Merge branch 'dev' into feature/linking-accounts

This commit is contained in:
MTG2000
2022-08-17 10:20:53 +03:00

View File

@@ -32,7 +32,6 @@ const loginHandler = async (req, res) => {
algorithms: ['HS256'],
})
const user_id = payload.user_id;
const existingKeys = await prisma.userKey.findMany({ where: { user_id }, select: { key: true } });
if (existingKeys.length >= 3)
@@ -47,7 +46,7 @@ const loginHandler = async (req, res) => {
});
// Remove old linking for this key if existing
await prisma.userKey.delete({
await prisma.userKey.deleteMany({
where: { key }
})