@explorins/pers-sdk-react-native 1.5.11 → 1.5.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTransactionSigner.d.ts","sourceRoot":"","sources":["../../src/hooks/useTransactionSigner.ts"],"names":[],"mappings":"AA6EA,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,oBAAoB;
|
|
1
|
+
{"version":3,"file":"useTransactionSigner.d.ts","sourceRoot":"","sources":["../../src/hooks/useTransactionSigner.ts"],"names":[],"mappings":"AA6EA,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,oBAAoB;IAoQ7B;;OAEG;2BAvE2C,MAAM,KAAG,QAAQ,wBAAwB,CAAC;IA0ExF;;OAEG;gCAjLgD;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;IAgLC;;OAEG;;IAGH;;OAEG;;CAGN,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE5E;;GAEG;AACH,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -95,12 +95,13 @@ export const useTransactionSigner = () => {
|
|
|
95
95
|
console.log('[useTransactionSigner] SDK config:', sdkConfig);
|
|
96
96
|
// Try to extract tenantId from JWT token if available
|
|
97
97
|
let tenantIdFromJWT;
|
|
98
|
+
let authToken;
|
|
98
99
|
if (authProvider.getToken) {
|
|
99
100
|
try {
|
|
100
|
-
|
|
101
|
-
if (
|
|
101
|
+
authToken = await authProvider.getToken();
|
|
102
|
+
if (authToken) {
|
|
102
103
|
// Decode JWT to get tenant information
|
|
103
|
-
const tokenParts =
|
|
104
|
+
const tokenParts = authToken.split('.');
|
|
104
105
|
if (tokenParts.length >= 2) {
|
|
105
106
|
const payload = JSON.parse(atob(tokenParts[1]));
|
|
106
107
|
console.log('[useTransactionSigner] JWT payload decoded:', payload);
|
|
@@ -183,13 +184,14 @@ export const useTransactionSigner = () => {
|
|
|
183
184
|
const { PersService } = await import('@explorins/pers-signer/react-native');
|
|
184
185
|
console.log('[useTransactionSigner] Initializing tenant for tenantId:', config.tenantId);
|
|
185
186
|
// We need to set the auth token first for tenant initialization
|
|
187
|
+
let authToken;
|
|
186
188
|
if (authProvider) {
|
|
187
189
|
try {
|
|
188
|
-
|
|
189
|
-
if (
|
|
190
|
+
authToken = await authProvider.getToken();
|
|
191
|
+
if (authToken) {
|
|
190
192
|
console.log('[useTransactionSigner] Setting auth token for tenant initialization');
|
|
191
193
|
PersService.configure({
|
|
192
|
-
token:
|
|
194
|
+
token: authToken
|
|
193
195
|
});
|
|
194
196
|
}
|
|
195
197
|
}
|
|
@@ -197,7 +199,7 @@ export const useTransactionSigner = () => {
|
|
|
197
199
|
console.warn('[useTransactionSigner] Could not get auth token for tenant initialization:', tokenError);
|
|
198
200
|
}
|
|
199
201
|
}
|
|
200
|
-
await PersService.initializeTenant(config.tenantId);
|
|
202
|
+
await PersService.initializeTenant(config.tenantId, authToken);
|
|
201
203
|
console.log('[useTransactionSigner] Tenant initialized successfully');
|
|
202
204
|
// Verify configuration
|
|
203
205
|
const persConfig = PersService.getConfig();
|
package/dist/index.js
CHANGED
|
@@ -30337,12 +30337,13 @@ const useTransactionSigner = () => {
|
|
|
30337
30337
|
console.log('[useTransactionSigner] SDK config:', sdkConfig);
|
|
30338
30338
|
// Try to extract tenantId from JWT token if available
|
|
30339
30339
|
let tenantIdFromJWT;
|
|
30340
|
+
let authToken;
|
|
30340
30341
|
if (authProvider.getToken) {
|
|
30341
30342
|
try {
|
|
30342
|
-
|
|
30343
|
-
if (
|
|
30343
|
+
authToken = await authProvider.getToken();
|
|
30344
|
+
if (authToken) {
|
|
30344
30345
|
// Decode JWT to get tenant information
|
|
30345
|
-
const tokenParts =
|
|
30346
|
+
const tokenParts = authToken.split('.');
|
|
30346
30347
|
if (tokenParts.length >= 2) {
|
|
30347
30348
|
const payload = JSON.parse(atob(tokenParts[1]));
|
|
30348
30349
|
console.log('[useTransactionSigner] JWT payload decoded:', payload);
|
|
@@ -30425,13 +30426,14 @@ const useTransactionSigner = () => {
|
|
|
30425
30426
|
const { PersService } = await Promise.resolve().then(function () { return require('./react-native.esm-BtyCg4n1.js'); });
|
|
30426
30427
|
console.log('[useTransactionSigner] Initializing tenant for tenantId:', config.tenantId);
|
|
30427
30428
|
// We need to set the auth token first for tenant initialization
|
|
30429
|
+
let authToken;
|
|
30428
30430
|
if (authProvider) {
|
|
30429
30431
|
try {
|
|
30430
|
-
|
|
30431
|
-
if (
|
|
30432
|
+
authToken = await authProvider.getToken();
|
|
30433
|
+
if (authToken) {
|
|
30432
30434
|
console.log('[useTransactionSigner] Setting auth token for tenant initialization');
|
|
30433
30435
|
PersService.configure({
|
|
30434
|
-
token:
|
|
30436
|
+
token: authToken
|
|
30435
30437
|
});
|
|
30436
30438
|
}
|
|
30437
30439
|
}
|
|
@@ -30439,7 +30441,7 @@ const useTransactionSigner = () => {
|
|
|
30439
30441
|
console.warn('[useTransactionSigner] Could not get auth token for tenant initialization:', tokenError);
|
|
30440
30442
|
}
|
|
30441
30443
|
}
|
|
30442
|
-
await PersService.initializeTenant(config.tenantId);
|
|
30444
|
+
await PersService.initializeTenant(config.tenantId, authToken);
|
|
30443
30445
|
console.log('[useTransactionSigner] Tenant initialized successfully');
|
|
30444
30446
|
// Verify configuration
|
|
30445
30447
|
const persConfig = PersService.getConfig();
|