Reverted temporary logging
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Nicolai Ort 2021-01-09 18:55:16 +01:00
parent 3b11e896d4
commit 8a54b027d0
1 changed files with 0 additions and 4 deletions

View File

@ -33,22 +33,18 @@ export class HandleLogout {
try {
decoded = jsonwebtoken.verify(this.token, config.jwt_secret)
} catch (error) {
console.log("decoding error")
throw new IllegalJWTError()
}
logout.timestamp = Math.floor(Date.now() / 1000)
let found_user: User = await getConnectionManager().get().getRepository(User).findOne({ id: decoded["id"] });
if (!found_user) {
console.log("user error")
throw new UserNotFoundError()
}
if (found_user.refreshTokenCount !== decoded["refreshTokenCount"]) {
console.log("invalid rtc")
throw new RefreshTokenCountInvalidError()
}
found_user.refreshTokenCount++;
await getConnectionManager().get().getRepository(User).update({ id: found_user.id }, found_user)
console.log("success")
return logout;
}
}