@edpire/sdk 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -55,6 +55,12 @@ const edpireTokenHandler = toNodeHandler(
|
|
|
55
55
|
* Returning null → 401 (no token minted).
|
|
56
56
|
*/
|
|
57
57
|
resolveLearner: (req) => {
|
|
58
|
+
// In development, use a fixed test ID so the player works out of the box.
|
|
59
|
+
// Replace this with your real session logic before going to production:
|
|
60
|
+
// express-session: req.session?.userId ?? null
|
|
61
|
+
// JWT: jwt.verify(cookie, JWT_SECRET).userId ?? null
|
|
62
|
+
if (isDev) return "dev-user-001"
|
|
63
|
+
|
|
58
64
|
const cookie = req.headers.get("cookie") ?? ""
|
|
59
65
|
const match = /(?:^|;\s*)userId=([^;]+)/.exec(cookie)
|
|
60
66
|
return match ? decodeURIComponent(match[1]) : null
|