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