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