@mindfulauth/core 2.0.0-beta.7 → 2.0.0-beta.8

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.
@@ -46,16 +46,12 @@ async function loadQRCodeLibrary() {
46
46
  // ============================================================================
47
47
 
48
48
  /**
49
- * Extracts recordid from window variable (injected server-side by backend)
50
- * Backend MUST inject this variable for all implementations
51
- * Architecture
52
- * - All protected routes require /{memberid}/page URL structure
53
- * - Backend extracts memberid from URL path and validates against session
54
- * - Frontend receives memberid via window.MEMBERID injection
55
- * @returns {string|null} The recordid if found, null otherwise
49
+ * Extracts the recordId from the URL path (/{memberid}/...).
50
+ * The memberid is the first path segment, already validated server-side by middleware.
51
+ * @returns {string|undefined} The recordId if found, undefined otherwise
56
52
  */
57
53
  function getRecordId() {
58
- return window.MEMBERID || null;
54
+ return window.location.pathname.split('/').filter(Boolean)[0] || undefined;
59
55
  }
60
56
 
61
57
  // ============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindfulauth/core",
3
- "version": "2.0.0-beta.7",
3
+ "version": "2.0.0-beta.8",
4
4
  "description": "Mindful Auth core authentication library for Astro 6",
5
5
  "type": "module",
6
6
  "main": "./dist/core/index.js",