@glideidentity/web-client-sdk 4.4.8-beta.2 → 4.4.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.
- package/README.md +395 -714
- package/dist/browser/web-client-sdk.min.js +1 -1
- package/dist/core/phone-auth/client.js +195 -75
- package/dist/core/phone-auth/strategies/desktop.d.ts +9 -3
- package/dist/core/phone-auth/strategies/desktop.js +47 -4
- package/dist/core/phone-auth/strategies/link.d.ts +8 -2
- package/dist/core/phone-auth/strategies/link.js +142 -14
- package/dist/core/phone-auth/types.d.ts +1 -1
- package/dist/core/phone-auth/ui/modal.d.ts +4 -0
- package/dist/core/phone-auth/ui/modal.js +17 -6
- package/dist/core/version.js +1 -1
- package/dist/esm/core/phone-auth/client.js +195 -75
- package/dist/esm/core/phone-auth/strategies/desktop.d.ts +9 -3
- package/dist/esm/core/phone-auth/strategies/desktop.js +47 -4
- package/dist/esm/core/phone-auth/strategies/link.d.ts +8 -2
- package/dist/esm/core/phone-auth/strategies/link.js +142 -14
- package/dist/esm/core/phone-auth/types.d.ts +1 -1
- package/dist/esm/core/phone-auth/ui/modal.d.ts +4 -0
- package/dist/esm/core/phone-auth/ui/modal.js +17 -6
- package/dist/esm/core/version.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -3
- package/package.json +1 -1
|
@@ -14,8 +14,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
14
|
};
|
|
15
15
|
export class LinkHandler {
|
|
16
16
|
constructor() {
|
|
17
|
-
this.
|
|
17
|
+
this.isPollingActive = false;
|
|
18
18
|
this.isCancelled = false;
|
|
19
|
+
this.isPollingInProgress = false;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Invoke link-based authentication
|
|
@@ -23,12 +24,20 @@ export class LinkHandler {
|
|
|
23
24
|
*/
|
|
24
25
|
invoke(data, options) {
|
|
25
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
console.log('[Link Auth] 🔗 invoke() called with data:', JSON.stringify(data, null, 2));
|
|
28
|
+
console.log('[Link Auth] Options:', options ? JSON.stringify({
|
|
29
|
+
pollingInterval: options.pollingInterval,
|
|
30
|
+
maxPollingAttempts: options.maxPollingAttempts,
|
|
31
|
+
pollingEndpoint: options.pollingEndpoint
|
|
32
|
+
}) : 'none');
|
|
26
33
|
// Extract link data from prepare response
|
|
27
34
|
const linkData = data.data;
|
|
28
35
|
if (!linkData || !linkData.url) {
|
|
29
36
|
throw new Error('Invalid link data: missing URL');
|
|
30
37
|
}
|
|
31
38
|
const sessionKey = data.session.session_key;
|
|
39
|
+
console.log('[Link Auth] Session key:', sessionKey);
|
|
40
|
+
console.log('[Link Auth] Link URL:', linkData.url);
|
|
32
41
|
// Open authentication app without navigating away from current page
|
|
33
42
|
this.openAuthenticationLink(linkData.url);
|
|
34
43
|
// Notify that link was opened
|
|
@@ -58,42 +67,97 @@ export class LinkHandler {
|
|
|
58
67
|
startPolling(sessionKey, linkData, options) {
|
|
59
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
69
|
const interval = (options === null || options === void 0 ? void 0 : options.pollingInterval) || 2000; // Fixed 2 second interval
|
|
61
|
-
const maxAttempts = (options === null || options === void 0 ? void 0 : options.maxPollingAttempts) ||
|
|
70
|
+
const maxAttempts = (options === null || options === void 0 ? void 0 : options.maxPollingAttempts) || 30; // 1 minute with 2s interval
|
|
62
71
|
let attempts = 0;
|
|
72
|
+
console.log('[Link Auth] 🚀 Starting polling:', {
|
|
73
|
+
sessionKey,
|
|
74
|
+
interval: `${interval}ms`,
|
|
75
|
+
maxAttempts,
|
|
76
|
+
linkDataAvailable: !!linkData
|
|
77
|
+
});
|
|
63
78
|
return new Promise((resolve, reject) => {
|
|
64
|
-
this.
|
|
79
|
+
this.isPollingActive = true;
|
|
80
|
+
this.pollingReject = reject; // Store reject function for cancel()
|
|
65
81
|
const poll = () => __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
if (!this.
|
|
82
|
+
if (!this.isPollingActive) {
|
|
67
83
|
return; // Polling was stopped
|
|
68
84
|
}
|
|
85
|
+
// Skip if another poll is already in progress
|
|
86
|
+
if (this.isPollingInProgress) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
let statusUrl = ''; // Declare at function scope for catch block access
|
|
69
90
|
try {
|
|
70
|
-
|
|
71
|
-
// Check max attempts
|
|
91
|
+
this.isPollingInProgress = true;
|
|
92
|
+
// Check max attempts before making the request
|
|
72
93
|
if (attempts >= maxAttempts) {
|
|
73
94
|
this.stopPolling();
|
|
74
95
|
if (options === null || options === void 0 ? void 0 : options.onTimeout) {
|
|
75
96
|
options.onTimeout();
|
|
76
97
|
}
|
|
98
|
+
// Calculate actual timeout duration
|
|
99
|
+
const timeoutSeconds = Math.round((maxAttempts * interval) / 1000);
|
|
100
|
+
const timeoutMessage = timeoutSeconds >= 60
|
|
101
|
+
? `${Math.floor(timeoutSeconds / 60)} minute${Math.floor(timeoutSeconds / 60) > 1 ? 's' : ''}`
|
|
102
|
+
: `${timeoutSeconds} seconds`;
|
|
77
103
|
if (options === null || options === void 0 ? void 0 : options.onStatusUpdate) {
|
|
78
104
|
options.onStatusUpdate({
|
|
79
105
|
status: 'expired',
|
|
80
|
-
message:
|
|
106
|
+
message: `Authentication timeout after ${timeoutMessage}`
|
|
81
107
|
});
|
|
82
108
|
}
|
|
83
|
-
reject(new Error(
|
|
109
|
+
reject(new Error(`Authentication timeout after ${timeoutMessage}`));
|
|
84
110
|
return;
|
|
85
111
|
}
|
|
86
112
|
// Build public status endpoint URL
|
|
87
|
-
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
113
|
+
// Use the same priority logic as Desktop strategy:
|
|
114
|
+
// 1. options?.pollingEndpoint (already contains invoke options OR client config from client.ts)
|
|
115
|
+
// 2. Backend-provided status_url from linkData
|
|
116
|
+
// 3. Hardcoded fallback to API server
|
|
117
|
+
let endpoint = options === null || options === void 0 ? void 0 : options.pollingEndpoint;
|
|
118
|
+
let endpointSource = 'options';
|
|
119
|
+
if (!endpoint && linkData.status_url) {
|
|
120
|
+
endpoint = linkData.status_url;
|
|
121
|
+
endpointSource = 'backend';
|
|
122
|
+
}
|
|
123
|
+
console.log('[Link Auth] Polling endpoint selection:');
|
|
124
|
+
console.log(' - options?.pollingEndpoint:', options === null || options === void 0 ? void 0 : options.pollingEndpoint);
|
|
125
|
+
console.log(' - linkData.status_url:', linkData.status_url);
|
|
126
|
+
console.log(' - selected endpoint:', endpoint, 'from source:', endpointSource);
|
|
127
|
+
// Build the status URL based on endpoint format (same as Desktop)
|
|
128
|
+
if (endpoint && (endpoint.startsWith('http://') || endpoint.startsWith('https://'))) {
|
|
129
|
+
// Full URL provided
|
|
130
|
+
if (endpoint.includes('{{session_id}}')) {
|
|
131
|
+
statusUrl = endpoint.replace('{{session_id}}', sessionKey);
|
|
132
|
+
}
|
|
133
|
+
else if (!endpoint.includes(sessionKey)) {
|
|
134
|
+
// If it doesn't already contain the session ID, check if it's a base URL
|
|
135
|
+
const url = new URL(endpoint);
|
|
136
|
+
statusUrl = `${url.protocol}//${url.host}/public/public/status/${sessionKey}`;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
statusUrl = endpoint;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else if (endpoint && endpoint !== '') {
|
|
143
|
+
// Relative path provided (e.g. '/api/phone-auth/status')
|
|
144
|
+
const origin = typeof window !== 'undefined' ? window.location.origin : '';
|
|
145
|
+
if (endpoint.includes('{{session_id}}')) {
|
|
146
|
+
statusUrl = origin + endpoint.replace('{{session_id}}', sessionKey);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// Append session ID to the provided endpoint
|
|
150
|
+
statusUrl = origin + endpoint + '/' + sessionKey;
|
|
151
|
+
}
|
|
92
152
|
}
|
|
93
153
|
else {
|
|
154
|
+
// No endpoint provided - use hardcoded fallback
|
|
94
155
|
statusUrl = `https://api.glideidentity.app/public/public/status/${sessionKey}`;
|
|
156
|
+
endpointSource = 'fallback';
|
|
95
157
|
}
|
|
158
|
+
console.log(`[Link Auth] Using ${endpointSource} endpoint: ${statusUrl}`);
|
|
96
159
|
// Poll public status endpoint - no authentication required
|
|
160
|
+
console.log(`[Link Auth] Polling status (attempt ${attempts}/${maxAttempts}): ${statusUrl}`);
|
|
97
161
|
const response = yield fetch(statusUrl, {
|
|
98
162
|
method: 'GET',
|
|
99
163
|
headers: {
|
|
@@ -101,12 +165,16 @@ export class LinkHandler {
|
|
|
101
165
|
// No Authorization header needed for public endpoint
|
|
102
166
|
}
|
|
103
167
|
});
|
|
168
|
+
console.log(`[Link Auth] Poll response - Status: ${response.status}, OK: ${response.ok}`);
|
|
104
169
|
// Handle based on HTTP status code
|
|
105
170
|
if (response.status === 200) {
|
|
106
171
|
// Session is active (pending or completed)
|
|
107
172
|
const result = yield response.json();
|
|
173
|
+
console.log('[Link Auth] Poll response data:', JSON.stringify(result, null, 2));
|
|
108
174
|
if (result.status === 'completed') {
|
|
109
175
|
// Authentication completed successfully
|
|
176
|
+
console.log('[Link Auth] ✅ Authentication COMPLETED! Session:', sessionKey);
|
|
177
|
+
console.log('[Link Auth] Full completion result:', JSON.stringify(result, null, 2));
|
|
110
178
|
this.stopPolling();
|
|
111
179
|
// Authentication completed successfully
|
|
112
180
|
if (options === null || options === void 0 ? void 0 : options.onStatusUpdate) {
|
|
@@ -117,6 +185,7 @@ export class LinkHandler {
|
|
|
117
185
|
});
|
|
118
186
|
}
|
|
119
187
|
// Return the authentication result
|
|
188
|
+
this.pollingReject = undefined; // Clear reject function on success
|
|
120
189
|
resolve({
|
|
121
190
|
authenticated: true,
|
|
122
191
|
credential: result.credential || sessionKey,
|
|
@@ -131,6 +200,8 @@ export class LinkHandler {
|
|
|
131
200
|
}
|
|
132
201
|
else if (result.status === 'pending') {
|
|
133
202
|
// Continue polling
|
|
203
|
+
console.log('[Link Auth] Status still pending, continuing to poll...');
|
|
204
|
+
attempts++; // Increment attempts after successful poll
|
|
134
205
|
if (options === null || options === void 0 ? void 0 : options.onStatusUpdate) {
|
|
135
206
|
options.onStatusUpdate({
|
|
136
207
|
status: 'pending',
|
|
@@ -138,9 +209,15 @@ export class LinkHandler {
|
|
|
138
209
|
});
|
|
139
210
|
}
|
|
140
211
|
}
|
|
212
|
+
else {
|
|
213
|
+
// Unexpected status value
|
|
214
|
+
console.log('[Link Auth] ⚠️ Unexpected status value:', result.status, 'Full result:', JSON.stringify(result, null, 2));
|
|
215
|
+
attempts++; // Increment for unexpected status too
|
|
216
|
+
}
|
|
141
217
|
}
|
|
142
218
|
else if (response.status === 410) {
|
|
143
219
|
// Session expired
|
|
220
|
+
console.log('[Link Auth] ❌ Session expired (410)');
|
|
144
221
|
this.stopPolling();
|
|
145
222
|
const errorData = yield response.json().catch(() => ({ message: 'Session expired' }));
|
|
146
223
|
if (options === null || options === void 0 ? void 0 : options.onTimeout) {
|
|
@@ -156,8 +233,10 @@ export class LinkHandler {
|
|
|
156
233
|
}
|
|
157
234
|
else if (response.status === 422) {
|
|
158
235
|
// Authentication failed
|
|
236
|
+
console.log('[Link Auth] ❌ Authentication failed (422)');
|
|
159
237
|
this.stopPolling();
|
|
160
238
|
const errorData = yield response.json().catch(() => ({ message: 'Authentication failed' }));
|
|
239
|
+
console.log('[Link Auth] Error data:', JSON.stringify(errorData, null, 2));
|
|
161
240
|
const isUserCancelled = errorData.code === 'USER_CANCELLED';
|
|
162
241
|
const errorMsg = isUserCancelled
|
|
163
242
|
? 'User cancelled authentication'
|
|
@@ -173,6 +252,7 @@ export class LinkHandler {
|
|
|
173
252
|
}
|
|
174
253
|
else if (response.status === 404) {
|
|
175
254
|
// Session not found
|
|
255
|
+
console.log('[Link Auth] ❌ Session not found (404)');
|
|
176
256
|
this.stopPolling();
|
|
177
257
|
if (options === null || options === void 0 ? void 0 : options.onStatusUpdate) {
|
|
178
258
|
options.onStatusUpdate({
|
|
@@ -184,16 +264,42 @@ export class LinkHandler {
|
|
|
184
264
|
}
|
|
185
265
|
else if (response.status === 400) {
|
|
186
266
|
// Invalid session key
|
|
267
|
+
console.log('[Link Auth] ❌ Invalid session key (400)');
|
|
187
268
|
this.stopPolling();
|
|
188
269
|
const errorData = yield response.json().catch(() => ({ message: 'Invalid session key' }));
|
|
270
|
+
console.log('[Link Auth] Error data:', JSON.stringify(errorData, null, 2));
|
|
189
271
|
reject(new Error(errorData.message || 'Invalid session key'));
|
|
190
272
|
}
|
|
191
273
|
else {
|
|
192
274
|
// Unexpected status - continue polling
|
|
275
|
+
console.log('[Link Auth] ⚠️ Unexpected HTTP status:', response.status, 'continuing to poll...');
|
|
276
|
+
attempts++; // Increment for unexpected HTTP status
|
|
277
|
+
try {
|
|
278
|
+
const body = yield response.text();
|
|
279
|
+
console.log('[Link Auth] Response body:', body);
|
|
280
|
+
}
|
|
281
|
+
catch (e) {
|
|
282
|
+
console.log('[Link Auth] Could not read response body');
|
|
283
|
+
}
|
|
193
284
|
}
|
|
194
285
|
}
|
|
195
286
|
catch (error) {
|
|
196
287
|
// Network or other error - continue polling
|
|
288
|
+
console.error('[Link Auth] 🔴 Polling error:', error.message || error);
|
|
289
|
+
attempts++; // Increment for error case
|
|
290
|
+
console.error('[Link Auth] Error details:', {
|
|
291
|
+
name: error.name,
|
|
292
|
+
message: error.message,
|
|
293
|
+
stack: error.stack,
|
|
294
|
+
statusUrl: statusUrl,
|
|
295
|
+
attempt: attempts,
|
|
296
|
+
error: error
|
|
297
|
+
});
|
|
298
|
+
// Check if it's a CORS error (common on mobile)
|
|
299
|
+
if (error.message && error.message.toLowerCase().includes('failed')) {
|
|
300
|
+
console.error('[Link Auth] ⚠️ Possible CORS issue. Status URL:', statusUrl);
|
|
301
|
+
console.error('[Link Auth] Make sure the API endpoint allows CORS from your ngrok domain');
|
|
302
|
+
}
|
|
197
303
|
if (options === null || options === void 0 ? void 0 : options.onStatusUpdate) {
|
|
198
304
|
options.onStatusUpdate({
|
|
199
305
|
status: 'pending',
|
|
@@ -201,6 +307,10 @@ export class LinkHandler {
|
|
|
201
307
|
});
|
|
202
308
|
}
|
|
203
309
|
}
|
|
310
|
+
finally {
|
|
311
|
+
// Always clear the polling flag when done
|
|
312
|
+
this.isPollingInProgress = false;
|
|
313
|
+
}
|
|
204
314
|
});
|
|
205
315
|
// Start initial poll immediately
|
|
206
316
|
poll();
|
|
@@ -213,7 +323,9 @@ export class LinkHandler {
|
|
|
213
323
|
* Stop polling
|
|
214
324
|
*/
|
|
215
325
|
stopPolling() {
|
|
216
|
-
|
|
326
|
+
console.log('[Link Auth] 🏁 Stopping polling');
|
|
327
|
+
this.isPollingActive = false;
|
|
328
|
+
this.isPollingInProgress = false;
|
|
217
329
|
if (this.pollingInterval) {
|
|
218
330
|
clearInterval(this.pollingInterval);
|
|
219
331
|
this.pollingInterval = undefined;
|
|
@@ -248,14 +360,30 @@ export class LinkHandler {
|
|
|
248
360
|
this.stopPolling();
|
|
249
361
|
this.isCancelled = false;
|
|
250
362
|
this.onCancel = undefined;
|
|
363
|
+
this.pollingReject = undefined;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Check if polling is currently active
|
|
367
|
+
*/
|
|
368
|
+
isPolling() {
|
|
369
|
+
return this.pollingInterval !== undefined;
|
|
251
370
|
}
|
|
252
371
|
/**
|
|
253
372
|
* Cancel the ongoing authentication
|
|
254
373
|
*/
|
|
255
374
|
cancel() {
|
|
256
375
|
var _a;
|
|
376
|
+
console.log('[Link Auth] Cancelling authentication');
|
|
257
377
|
this.isCancelled = true;
|
|
258
378
|
this.stopPolling();
|
|
259
379
|
(_a = this.onCancel) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
380
|
+
// Immediately reject the polling promise
|
|
381
|
+
if (this.pollingReject) {
|
|
382
|
+
this.pollingReject({
|
|
383
|
+
code: 'USER_DENIED',
|
|
384
|
+
message: 'Authentication cancelled by user'
|
|
385
|
+
});
|
|
386
|
+
this.pollingReject = undefined;
|
|
387
|
+
}
|
|
260
388
|
}
|
|
261
389
|
}
|
|
@@ -72,7 +72,7 @@ export interface AuthConfig extends PhoneAuthCallbacks {
|
|
|
72
72
|
pollingInterval?: number;
|
|
73
73
|
/**
|
|
74
74
|
* Maximum polling attempts before timeout
|
|
75
|
-
* @default
|
|
75
|
+
* @default 30 (1 minute with 2s interval)
|
|
76
76
|
*/
|
|
77
77
|
maxPollingAttempts?: number;
|
|
78
78
|
/**
|
|
@@ -26,6 +26,10 @@ export declare class AuthModal {
|
|
|
26
26
|
private closeCallback?;
|
|
27
27
|
constructor(options?: InvokeOptions['modalOptions'], callbacks?: InvokeOptions['callbacks']);
|
|
28
28
|
private handleEscapeKey;
|
|
29
|
+
/**
|
|
30
|
+
* Escape HTML to prevent XSS attacks
|
|
31
|
+
*/
|
|
32
|
+
private escapeHtml;
|
|
29
33
|
/**
|
|
30
34
|
* Shows the modal with a QR code for desktop authentication
|
|
31
35
|
* Supports both single QR code (legacy) and dual-platform QR codes (iOS + Android)
|
|
@@ -44,6 +44,17 @@ export class AuthModal {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Escape HTML to prevent XSS attacks
|
|
49
|
+
*/
|
|
50
|
+
escapeHtml(unsafe) {
|
|
51
|
+
return unsafe
|
|
52
|
+
.replace(/&/g, "&")
|
|
53
|
+
.replace(/</g, "<")
|
|
54
|
+
.replace(/>/g, ">")
|
|
55
|
+
.replace(/"/g, """)
|
|
56
|
+
.replace(/'/g, "'");
|
|
57
|
+
}
|
|
47
58
|
/**
|
|
48
59
|
* Shows the modal with a QR code for desktop authentication
|
|
49
60
|
* Supports both single QR code (legacy) and dual-platform QR codes (iOS + Android)
|
|
@@ -72,7 +83,7 @@ export class AuthModal {
|
|
|
72
83
|
// Only iOS QR code available - show single QR
|
|
73
84
|
this.createModal(`
|
|
74
85
|
<div class="glide-auth-qr-container">
|
|
75
|
-
<img src="${qrCodeData.iosQRCode}" alt="QR Code" class="glide-auth-qr-code" />
|
|
86
|
+
<img src="${this.escapeHtml(qrCodeData.iosQRCode)}" alt="QR Code" class="glide-auth-qr-code" />
|
|
76
87
|
<p class="glide-auth-status">Scan with your iPhone to authenticate</p>
|
|
77
88
|
</div>
|
|
78
89
|
`);
|
|
@@ -83,8 +94,8 @@ export class AuthModal {
|
|
|
83
94
|
// Legacy single QR code
|
|
84
95
|
this.createModal(`
|
|
85
96
|
<div class="glide-auth-qr-container">
|
|
86
|
-
<img src="${qrCodeData}" alt="QR Code" class="glide-auth-qr-code" />
|
|
87
|
-
<p class="glide-auth-status">${statusMessage}</p>
|
|
97
|
+
<img src="${this.escapeHtml(qrCodeData)}" alt="QR Code" class="glide-auth-qr-code" />
|
|
98
|
+
<p class="glide-auth-status">${this.escapeHtml(statusMessage)}</p>
|
|
88
99
|
</div>
|
|
89
100
|
`);
|
|
90
101
|
}
|
|
@@ -115,11 +126,11 @@ export class AuthModal {
|
|
|
115
126
|
<!-- QR Code Image -->
|
|
116
127
|
<img
|
|
117
128
|
id="glide-qr-code-img"
|
|
118
|
-
src="${qrCodeData.iosQRCode}"
|
|
129
|
+
src="${this.escapeHtml(qrCodeData.iosQRCode)}"
|
|
119
130
|
alt="QR Code"
|
|
120
131
|
class="glide-auth-qr-code"
|
|
121
|
-
data-ios="${qrCodeData.iosQRCode}"
|
|
122
|
-
data-android="${qrCodeData.androidQRCode}"
|
|
132
|
+
data-ios="${this.escapeHtml(qrCodeData.iosQRCode)}"
|
|
133
|
+
data-android="${this.escapeHtml(qrCodeData.androidQRCode || '')}"
|
|
123
134
|
/>
|
|
124
135
|
|
|
125
136
|
<!-- Status Message -->
|
package/dist/esm/core/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// SDK version - injected at build time
|
|
2
|
-
export const SDK_VERSION = '4.4.8
|
|
2
|
+
export const SDK_VERSION = '4.4.8';
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { PhoneAuthErrorCode, isPhoneAuthError, isUserError, getUserMessage, isEr
|
|
|
4
4
|
export { isExtendedResponse, isCredential, isAuthCredential, isLinkStrategy, isTS43Strategy, isDesktopStrategy, getStrategy, hasPollingControls, hasTrigger, isHeadlessResult, requiresPolling, requiresUserAction } from './core/phone-auth';
|
|
5
5
|
export type { PhoneAuthCallbacks, PLMN, SessionInfo, InvokeOptions, ExecutionMode, AuthCredential, AnyExtendedResponse, DesktopExtendedResponse, LinkExtendedResponse, TS43ExtendedResponse, PrepareRequest, PrepareResponse, GetPhoneNumberRequest, GetPhoneNumberResponse, VerifyPhoneNumberRequest, VerifyPhoneNumberResponse, SecureCredentialRequest, SecureCredentialResponse, DigitalCredential, TS43Data, LinkData, DesktopData, ClientInfo, ConsentData, BrowserErrorType, BrowserErrorCodeType, BrowserNameType } from './core/phone-auth/types';
|
|
6
6
|
export { USE_CASE as UseCase, AUTHENTICATION_STRATEGY as AuthenticationStrategy, BrowserError, BrowserErrorCode, BrowserName } from './core/phone-auth/types';
|
|
7
|
-
export { DesktopHandler
|
|
7
|
+
export { DesktopHandler } from './core/phone-auth/strategies/desktop';
|
|
8
8
|
export type { DesktopAuthOptions, DesktopAuthResult, PollingStatus, QRCodeData } from './core/phone-auth/strategies/desktop';
|
|
9
9
|
export { useClient, usePhoneAuth } from './adapters/react';
|
|
10
10
|
export { useClient as useVueClient, usePhoneAuth as useVuePhoneAuth } from './adapters/vue';
|
package/dist/esm/index.js
CHANGED
|
@@ -9,7 +9,7 @@ isHeadlessResult, requiresPolling, requiresUserAction } from './core/phone-auth'
|
|
|
9
9
|
// Export constants for use case and strategy
|
|
10
10
|
export { USE_CASE as UseCase, AUTHENTICATION_STRATEGY as AuthenticationStrategy, BrowserError, BrowserErrorCode, BrowserName } from './core/phone-auth/types';
|
|
11
11
|
// Desktop Strategy Exports
|
|
12
|
-
export { DesktopHandler
|
|
12
|
+
export { DesktopHandler } from './core/phone-auth/strategies/desktop';
|
|
13
13
|
// Adapters
|
|
14
14
|
export { useClient, usePhoneAuth } from './adapters/react';
|
|
15
15
|
export { useClient as useVueClient, usePhoneAuth as useVuePhoneAuth } from './adapters/vue';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { PhoneAuthErrorCode, isPhoneAuthError, isUserError, getUserMessage, isEr
|
|
|
4
4
|
export { isExtendedResponse, isCredential, isAuthCredential, isLinkStrategy, isTS43Strategy, isDesktopStrategy, getStrategy, hasPollingControls, hasTrigger, isHeadlessResult, requiresPolling, requiresUserAction } from './core/phone-auth';
|
|
5
5
|
export type { PhoneAuthCallbacks, PLMN, SessionInfo, InvokeOptions, ExecutionMode, AuthCredential, AnyExtendedResponse, DesktopExtendedResponse, LinkExtendedResponse, TS43ExtendedResponse, PrepareRequest, PrepareResponse, GetPhoneNumberRequest, GetPhoneNumberResponse, VerifyPhoneNumberRequest, VerifyPhoneNumberResponse, SecureCredentialRequest, SecureCredentialResponse, DigitalCredential, TS43Data, LinkData, DesktopData, ClientInfo, ConsentData, BrowserErrorType, BrowserErrorCodeType, BrowserNameType } from './core/phone-auth/types';
|
|
6
6
|
export { USE_CASE as UseCase, AUTHENTICATION_STRATEGY as AuthenticationStrategy, BrowserError, BrowserErrorCode, BrowserName } from './core/phone-auth/types';
|
|
7
|
-
export { DesktopHandler
|
|
7
|
+
export { DesktopHandler } from './core/phone-auth/strategies/desktop';
|
|
8
8
|
export type { DesktopAuthOptions, DesktopAuthResult, PollingStatus, QRCodeData } from './core/phone-auth/strategies/desktop';
|
|
9
9
|
export { useClient, usePhoneAuth } from './adapters/react';
|
|
10
10
|
export { useClient as useVueClient, usePhoneAuth as useVuePhoneAuth } from './adapters/vue';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PhoneAuthManager = exports.ClientManager = exports.PhoneAuthService = exports.ClientService = exports.useVuePhoneAuth = exports.useVueClient = exports.usePhoneAuth = exports.useClient = exports.
|
|
3
|
+
exports.PhoneAuthManager = exports.ClientManager = exports.PhoneAuthService = exports.ClientService = exports.useVuePhoneAuth = exports.useVueClient = exports.usePhoneAuth = exports.useClient = exports.DesktopHandler = exports.BrowserName = exports.BrowserErrorCode = exports.BrowserError = exports.AuthenticationStrategy = exports.UseCase = exports.requiresUserAction = exports.requiresPolling = exports.isHeadlessResult = exports.hasTrigger = exports.hasPollingControls = exports.getStrategy = exports.isDesktopStrategy = exports.isTS43Strategy = exports.isLinkStrategy = exports.isAuthCredential = exports.isCredential = exports.isExtendedResponse = exports.createErrorBreadcrumb = exports.serializeError = exports.isRetryableError = exports.getRetryDelay = exports.isErrorCode = exports.getUserMessage = exports.isUserError = exports.isPhoneAuthError = exports.PhoneAuthErrorCode = exports.PhoneAuthClient = void 0;
|
|
4
4
|
// Phone Authentication
|
|
5
5
|
var phone_auth_1 = require("./core/phone-auth");
|
|
6
6
|
Object.defineProperty(exports, "PhoneAuthClient", { enumerable: true, get: function () { return phone_auth_1.PhoneAuthClient; } });
|
|
@@ -40,8 +40,6 @@ Object.defineProperty(exports, "BrowserName", { enumerable: true, get: function
|
|
|
40
40
|
// Desktop Strategy Exports
|
|
41
41
|
var desktop_1 = require("./core/phone-auth/strategies/desktop");
|
|
42
42
|
Object.defineProperty(exports, "DesktopHandler", { enumerable: true, get: function () { return desktop_1.DesktopHandler; } });
|
|
43
|
-
Object.defineProperty(exports, "showQRCodeModal", { enumerable: true, get: function () { return desktop_1.showQRCodeModal; } });
|
|
44
|
-
Object.defineProperty(exports, "createQRCodeDisplay", { enumerable: true, get: function () { return desktop_1.createQRCodeDisplay; } });
|
|
45
43
|
// Adapters
|
|
46
44
|
var react_1 = require("./adapters/react");
|
|
47
45
|
Object.defineProperty(exports, "useClient", { enumerable: true, get: function () { return react_1.useClient; } });
|