mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 15:08:46 +00:00
마지막 접속 IP와 User Agent가 빈 값인 경우 DB에 해당 정보를 기록하지 않도록 수정
This commit is contained in:
@@ -20,8 +20,8 @@ export const createSession = async (
|
|||||||
clientId,
|
clientId,
|
||||||
createdAt: now,
|
createdAt: now,
|
||||||
lastUsedAt: now,
|
lastUsedAt: now,
|
||||||
lastUsedByIp: ip,
|
lastUsedByIp: ip || null,
|
||||||
lastUsedByUserAgent: userAgent,
|
lastUsedByUserAgent: userAgent || null,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof SqliteError && e.code === "SQLITE_CONSTRAINT_UNIQUE") {
|
if (e instanceof SqliteError && e.code === "SQLITE_CONSTRAINT_UNIQUE") {
|
||||||
@@ -41,8 +41,8 @@ export const refreshSession = async (
|
|||||||
.update(session)
|
.update(session)
|
||||||
.set({
|
.set({
|
||||||
lastUsedAt: now,
|
lastUsedAt: now,
|
||||||
lastUsedByIp: ip ?? undefined,
|
lastUsedByIp: ip || undefined,
|
||||||
lastUsedByUserAgent: userAgent ?? undefined,
|
lastUsedByUserAgent: userAgent || undefined,
|
||||||
})
|
})
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
|
|||||||
Reference in New Issue
Block a user