@explorins/pers-signer 1.0.32 → 1.0.33
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/browser.cjs.js +6 -2
- package/dist/browser.cjs.js.map +1 -1
- package/dist/browser.esm.js +6 -2
- package/dist/browser.esm.js.map +1 -1
- package/dist/index.cjs.js +6 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/react-native.cjs.js +6 -2
- package/dist/react-native.cjs.js.map +1 -1
- package/dist/react-native.esm.js +6 -2
- package/dist/react-native.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/browser.cjs.js
CHANGED
|
@@ -1781,12 +1781,16 @@ class PersSignerSDK {
|
|
|
1781
1781
|
*/
|
|
1782
1782
|
constructor(config) {
|
|
1783
1783
|
this.config = config;
|
|
1784
|
+
// Safe hostname/origin extraction - window.location may be undefined in React Native
|
|
1785
|
+
const hasWindowLocation = typeof window !== 'undefined' && typeof window.location !== 'undefined';
|
|
1786
|
+
const hostname = hasWindowLocation ? window.location.hostname : 'localhost';
|
|
1787
|
+
const origin = hasWindowLocation ? window.location.origin : undefined;
|
|
1784
1788
|
setConfigProvider(new WebConfigProvider({
|
|
1785
1789
|
apiUrl: config.apiUrl || SIGNER_CONFIG.DEFAULT_SIGNER_API_URL,
|
|
1786
1790
|
relyingParty: {
|
|
1787
|
-
id:
|
|
1791
|
+
id: hostname,
|
|
1788
1792
|
name: config.relyingPartyName || SIGNER_CONFIG.DEFAULT_RELYING_PARTY_NAME,
|
|
1789
|
-
origin:
|
|
1793
|
+
origin: origin,
|
|
1790
1794
|
},
|
|
1791
1795
|
}));
|
|
1792
1796
|
this.authenticationService = new AuthenticationService(this.config);
|