79834258

Date: 2025-12-01 00:04:16
Score: 1
Natty:
Report link

What it returns right now it's not really undefined but a promise.

Because it is an async function, you need to await:

const session = await getUserSession("abc123");
console.log(session); // → "{"userId":123,...}"

If you can't await:

getUserSession("abc123").then(session => { console.log(session); })
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): What it
  • Low reputation (0.5):
Posted by: learntheropes