@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.
@@ -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
- * ```typescript
139
- * try {
140
- * const session = await oxyServices.signInWithFedCM();
141
- * console.log('Signed in:', session.user);
142
- * } catch (error) {
143
- * // Fallback to redirect auth
144
- * oxyServices.signInWithRedirect();
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 status = errorAny?.status || errorAny?.response?.status;
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') ||