@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/index.cjs.js
CHANGED
|
@@ -2158,12 +2158,16 @@ class PersSignerSDK {
|
|
|
2158
2158
|
*/
|
|
2159
2159
|
constructor(config) {
|
|
2160
2160
|
this.config = config;
|
|
2161
|
+
// Safe hostname/origin extraction - window.location may be undefined in React Native
|
|
2162
|
+
const hasWindowLocation = typeof window !== 'undefined' && typeof window.location !== 'undefined';
|
|
2163
|
+
const hostname = hasWindowLocation ? window.location.hostname : 'localhost';
|
|
2164
|
+
const origin = hasWindowLocation ? window.location.origin : undefined;
|
|
2161
2165
|
setConfigProvider(new WebConfigProvider({
|
|
2162
2166
|
apiUrl: config.apiUrl || SIGNER_CONFIG.DEFAULT_SIGNER_API_URL,
|
|
2163
2167
|
relyingParty: {
|
|
2164
|
-
id:
|
|
2168
|
+
id: hostname,
|
|
2165
2169
|
name: config.relyingPartyName || SIGNER_CONFIG.DEFAULT_RELYING_PARTY_NAME,
|
|
2166
|
-
origin:
|
|
2170
|
+
origin: origin,
|
|
2167
2171
|
},
|
|
2168
2172
|
}));
|
|
2169
2173
|
this.authenticationService = new AuthenticationService(this.config);
|