• d

    dbMI

    1 year ago
    @User, I've tried but I'm getting undefined.
  • d

    dbMI

    1 year ago
    let userId = req.session.getUserId(); let user = getUserById(userId); let email = user.email;
  • d

    dbMI

    1 year ago
    This is the code for entire route:
  • d

    dbMI

    1 year ago
    app.get("/sessioninfo", Session.verifySession(), async (req, res) => { let session = req.session; let sessionData = await session.getSessionData(); let userId = req.session.getUserId(); let user = getUserById(userId); let email = user.email; console.log("email: " + email); console.log(sessionData); res.send({ sessionHandle: session.getHandle(), userId: session.getUserId(), jwtPayload: session.getJWTPayload(), sessionData: await session.getSessionData(), }); });
  • d

    dbMI

    1 year ago
    the console.log for email is undefined and the console.log for sessionData is {}
  • r

    rp

    1 year ago
    @User What is the console log for
    userId
    ?
  • r

    rp

    1 year ago
    is it a UUID?
  • r

    rp

    1 year ago
    and you may want to do
    let user = await getUserById(userId);
  • r

    rp

    1 year ago
    i.e. add an
    await
  • d

    dbMI

    1 year ago
    Ok. the await worked. thanks.