@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
|
@@ -139,13 +139,13 @@ function OxyServicesFedCMMixin(Base) {
|
|
|
139
139
|
* @throws {OxyAuthenticationError} If FedCM not supported or user cancels
|
|
140
140
|
*
|
|
141
141
|
* @example
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
* ```typescript
|
|
143
|
+
* try {
|
|
144
|
+
* const session = await oxyServices.signInWithFedCM();
|
|
145
|
+
* const user = session.user;
|
|
146
|
+
* } catch (error) {
|
|
147
|
+
* // Fallback to redirect auth
|
|
148
|
+
* oxyServices.signInWithRedirect();
|
|
149
149
|
* }
|
|
150
150
|
* ```
|
|
151
151
|
*/
|
|
@@ -185,9 +185,15 @@ function OxyServicesUserMixin(Base) {
|
|
|
185
185
|
return result;
|
|
186
186
|
}
|
|
187
187
|
catch (error) {
|
|
188
|
-
const errorAny = error;
|
|
189
188
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
190
|
-
const
|
|
189
|
+
const errorRecord = error && typeof error === 'object'
|
|
190
|
+
? error
|
|
191
|
+
: null;
|
|
192
|
+
const status = typeof errorRecord?.status === 'number'
|
|
193
|
+
? errorRecord.status
|
|
194
|
+
: typeof errorRecord?.response?.status === 'number'
|
|
195
|
+
? errorRecord.response.status
|
|
196
|
+
: undefined;
|
|
191
197
|
// Check if it's an authentication error (401)
|
|
192
198
|
const isAuthError = status === 401 ||
|
|
193
199
|
errorMessage.includes('Authentication required') ||
|