Resolve login problem

This commit is contained in:
aronmal 2023-02-14 21:39:44 +01:00
parent 945ae9d1ac
commit 9e1522426a
Signed by: aronmal
GPG key ID: 816B7707426FC612

View file

@ -58,8 +58,13 @@ async function preCheck<T>(
id: tokenData.id,
},
}))
if (!oldDBToken) return
if (!oldDBToken.used)
if (!oldDBToken)
logging(
"Cookie could be verified but wasn't found in DB:" + tokenData,
["debug"],
req
)
else if (!oldDBToken.used)
logging("Old token was used: " + oldDBToken.id, ["debug"], req)
else {
await prisma.token.update({