Ticket: User Management [loginUser]

await sessions.updateOne(
{ user_id: email },
{ $set: { jwt: jwt } },
{ upsert: true },

× it allows a user to login (1227ms)
Any idea what am I doing wrong here?


static async getUserSession(email) {
    try {
      // TODO Ticket: User Management
      // Retrieve the session document corresponding with the user's email.
      **return sessions.findOne({ email: email })**
    } catch (e) {
      console.error(`Error occurred while retrieving user session, ${e}`)
      return null

The highlighted return part is returning null for some reason

Fixed by changing email to user_id