Skip to content

Commit

Permalink
#77 fix have many user session
Browse files Browse the repository at this point in the history
  • Loading branch information
code-ga committed Aug 6, 2022
1 parent 6d75515 commit 812c0b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/user/src/util/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ export async function GenToken(
},
],
})
await session.deleteMany({
userID: new ObjectId(userID),
})
const sessionID = await session.insertOne({
createdAt: new Date(expTime),
updatedAt: new Date(),
userID: userID,
userID: new ObjectId(userID),
})
const exp = getNumericDate(expTime)
const jwt = await create(
Expand Down

0 comments on commit 812c0b6

Please sign in to comment.