@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.
@@ -139,13 +139,13 @@ function OxyServicesFedCMMixin(Base) {
139
139
  * @throws {OxyAuthenticationError} If FedCM not supported or user cancels
140
140
  *
141
141
  * @example
142
- * ```typescript
143
- * try {
144
- * const session = await oxyServices.signInWithFedCM();
145
- * console.log('Signed in:', session.user);
146
- * } catch (error) {
147
- * // Fallback to redirect auth
148
- * oxyServices.signInWithRedirect();
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 status = errorAny?.status || errorAny?.response?.status;
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') ||