@proveanything/smartlinks-auth-ui 0.1.13 → 0.1.14
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.
- package/dist/context/AuthContext.d.ts.map +1 -1
- package/dist/index.esm.js +7 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthContext.d.ts","sourceRoot":"","sources":["../../src/context/AuthContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthContext.d.ts","sourceRoot":"","sources":["../../src/context/AuthContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AAKnG,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAElE,UAAU,gBAAgB;IACxB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACxC,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3F,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACrE,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACnD,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,uBAAuB,KAAK,MAAM,IAAI,CAAC;CACtE;AAID,UAAU,iBAAiB;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA+YpD,CAAC;AAEF,eAAO,MAAM,OAAO,QAAO,gBAM1B,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React, { useEffect, useState, useRef, useCallback, useMemo, createContext, useContext } from 'react';
|
|
3
3
|
import * as smartlinks from '@proveanything/smartlinks';
|
|
4
|
+
import { iframe } from '@proveanything/smartlinks';
|
|
4
5
|
|
|
5
6
|
const AuthContainer = ({ children, theme = 'light', className = '', config, minimal = false, }) => {
|
|
6
7
|
// Apply CSS variables for customization
|
|
@@ -11428,9 +11429,9 @@ const AuthProvider = ({ children, proxyMode = false, accountCacheTTL = 5 * 60 *
|
|
|
11428
11429
|
setAccountData(authAccountData || null);
|
|
11429
11430
|
// Cross-iframe auth state synchronization
|
|
11430
11431
|
// Always notify parent frame of login (both modes, but especially important in proxy mode)
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
|
|
11432
|
+
if (iframe.isIframe()) {
|
|
11433
|
+
console.log('[AuthContext] Notifying parent of login via postMessage');
|
|
11434
|
+
iframe.sendParentCustom('smartlinks:authkit:login', {
|
|
11434
11435
|
token: authToken,
|
|
11435
11436
|
user: authUser,
|
|
11436
11437
|
accountData: authAccountData || null
|
|
@@ -11463,9 +11464,9 @@ const AuthProvider = ({ children, proxyMode = false, accountCacheTTL = 5 * 60 *
|
|
|
11463
11464
|
setAccountInfo(null);
|
|
11464
11465
|
// Cross-iframe auth state synchronization
|
|
11465
11466
|
// Always notify parent frame of logout
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11467
|
+
if (iframe.isIframe()) {
|
|
11468
|
+
console.log('[AuthContext] Notifying parent of logout via postMessage');
|
|
11469
|
+
iframe.sendParentCustom('smartlinks:authkit:logout', {});
|
|
11469
11470
|
}
|
|
11470
11471
|
notifyAuthStateChange('LOGOUT', null, null, null);
|
|
11471
11472
|
}
|