Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Aug 26, 2024
1 parent a0dc54e commit 7ac259e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/server/callbacks/signin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,12 @@ async function updateUserLogin(userId: string): Promise<void> {
});
}

async function upsertDeviceInfo(
deviceInfo: DeviceInfo,
ipAddress: string,
): Promise<void> {
async function upsertDeviceInfo(deviceInfo: DeviceInfo): Promise<void> {
await prisma.userDevice.upsert({
where: { deviceId: deviceInfo.deviceId },
update: {
lastActive: deviceInfo.lastActive,
ipAddress,
ipAddress: deviceInfo.ipAddress,
isActive: true,
},
create: deviceInfo,
Expand Down Expand Up @@ -158,7 +155,7 @@ export function signInCallback(
existingUser.id,
ipAddress,
);
await upsertDeviceInfo(deviceInfo, ipAddress);
await upsertDeviceInfo(deviceInfo);
user.deviceId = deviceInfo.deviceId;
}

Expand Down

0 comments on commit 7ac259e

Please sign in to comment.