mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
get coutry using maxmind and clear stale device codes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { build } from "@server/build";
|
||||
import { db, sessionTransferToken } from "@server/db";
|
||||
import { db, deviceWebAuthCodes, sessionTransferToken } from "@server/db";
|
||||
import {
|
||||
emailVerificationCodes,
|
||||
newtSessions,
|
||||
@@ -89,4 +89,12 @@ export async function clearStaleData() {
|
||||
logger.warn("Error clearing expired sessionTransferToken:", e);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await db
|
||||
.delete(deviceWebAuthCodes)
|
||||
.where(lt(deviceWebAuthCodes.expiresAt, new Date().getTime()));
|
||||
} catch (e) {
|
||||
logger.warn("Error clearing expired deviceWebAuthCodes:", e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user