@oxyhq/core 3.4.9 → 3.4.10
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/mixins/OxyServices.fedcm.js +7 -7
- package/dist/cjs/mixins/OxyServices.user.js +8 -2
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/mixins/OxyServices.fedcm.js +7 -7
- package/dist/esm/mixins/OxyServices.user.js +8 -2
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/mixins/OxyServices.fedcm.d.ts +7 -7
- package/dist/types/mixins/OxyServices.user.d.ts +1 -3
- package/package.json +1 -1
- package/src/mixins/OxyServices.fedcm.ts +7 -7
- package/src/mixins/OxyServices.user.ts +10 -4
|
@@ -71,13 +71,13 @@ export declare function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(
|
|
|
71
71
|
* @throws {OxyAuthenticationError} If FedCM not supported or user cancels
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
* ```typescript
|
|
75
|
+
* try {
|
|
76
|
+
* const session = await oxyServices.signInWithFedCM();
|
|
77
|
+
* const user = session.user;
|
|
78
|
+
* } catch (error) {
|
|
79
|
+
* // Fallback to redirect auth
|
|
80
|
+
* oxyServices.signInWithRedirect();
|
|
81
81
|
* }
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
@@ -262,9 +262,7 @@ export declare function OxyServicesUserMixin<T extends typeof OxyServicesBase>(B
|
|
|
262
262
|
getActingAs(): string | null;
|
|
263
263
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
264
264
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
265
|
-
maxRetries
|
|
266
|
-
* Download account data export
|
|
267
|
-
*/: number;
|
|
265
|
+
maxRetries?: number;
|
|
268
266
|
retryDelay?: number;
|
|
269
267
|
authTimeoutMs?: number;
|
|
270
268
|
}): Promise<T_1>;
|
package/package.json
CHANGED
|
@@ -255,13 +255,13 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
255
255
|
* @throws {OxyAuthenticationError} If FedCM not supported or user cancels
|
|
256
256
|
*
|
|
257
257
|
* @example
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
258
|
+
* ```typescript
|
|
259
|
+
* try {
|
|
260
|
+
* const session = await oxyServices.signInWithFedCM();
|
|
261
|
+
* const user = session.user;
|
|
262
|
+
* } catch (error) {
|
|
263
|
+
* // Fallback to redirect auth
|
|
264
|
+
* oxyServices.signInWithRedirect();
|
|
265
265
|
* }
|
|
266
266
|
* ```
|
|
267
267
|
*/
|
|
@@ -243,12 +243,18 @@ export function OxyServicesUserMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
243
243
|
|
|
244
244
|
return result;
|
|
245
245
|
} catch (error) {
|
|
246
|
-
const errorAny = error as any;
|
|
247
246
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
248
|
-
const
|
|
249
|
-
|
|
247
|
+
const errorRecord = error && typeof error === 'object'
|
|
248
|
+
? error as { status?: unknown; response?: { status?: unknown } }
|
|
249
|
+
: null;
|
|
250
|
+
const status = typeof errorRecord?.status === 'number'
|
|
251
|
+
? errorRecord.status
|
|
252
|
+
: typeof errorRecord?.response?.status === 'number'
|
|
253
|
+
? errorRecord.response.status
|
|
254
|
+
: undefined;
|
|
255
|
+
|
|
250
256
|
// Check if it's an authentication error (401)
|
|
251
|
-
const isAuthError = status === 401 ||
|
|
257
|
+
const isAuthError = status === 401 ||
|
|
252
258
|
errorMessage.includes('Authentication required') ||
|
|
253
259
|
errorMessage.includes('Invalid or missing authorization header');
|
|
254
260
|
|