@oxyhq/core 2.1.0 → 2.1.1

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.
@@ -21,6 +21,7 @@
21
21
  * const session = await auth.signInWithPopup();
22
22
  * ```
23
23
  */
24
+ import { logger } from './utils/loggerUtils.js';
24
25
  export class CrossDomainAuth {
25
26
  constructor(oxyServices) {
26
27
  this.oxyServices = oxyServices;
@@ -94,7 +95,7 @@ export class CrossDomainAuth {
94
95
  return session;
95
96
  }
96
97
  catch (error) {
97
- console.warn('[CrossDomainAuth] FedCM failed, trying popup...', error);
98
+ logger.warn('FedCM failed, trying popup', { component: 'CrossDomainAuth', method: 'autoSignIn' }, error);
98
99
  }
99
100
  }
100
101
  // 2. Try popup (good UX, widely supported)
@@ -103,7 +104,7 @@ export class CrossDomainAuth {
103
104
  return await this.signInWithPopup(options);
104
105
  }
105
106
  catch (error) {
106
- console.warn('[CrossDomainAuth] Popup failed, falling back to redirect...', error);
107
+ logger.warn('Popup failed, falling back to redirect', { component: 'CrossDomainAuth', method: 'autoSignIn' }, error);
107
108
  // Popup path failed — close the pre-opened popup before redirecting.
108
109
  this.closeOrphanPopup(options.popup);
109
110
  }
@@ -172,7 +173,7 @@ export class CrossDomainAuth {
172
173
  }
173
174
  }
174
175
  catch (error) {
175
- console.warn('[CrossDomainAuth] FedCM silent sign-in failed:', error);
176
+ logger.debug('FedCM silent sign-in did not resolve', { component: 'CrossDomainAuth', method: 'silentSignIn' }, error);
176
177
  }
177
178
  }
178
179
  // Fallback to iframe-based silent auth
@@ -180,7 +181,7 @@ export class CrossDomainAuth {
180
181
  return await this.oxyServices.silentSignIn();
181
182
  }
182
183
  catch (error) {
183
- console.warn('[CrossDomainAuth] Silent sign-in failed:', error);
184
+ logger.debug('iframe silent sign-in did not resolve', { component: 'CrossDomainAuth', method: 'silentSignIn' }, error);
184
185
  return null;
185
186
  }
186
187
  }
@@ -265,7 +266,7 @@ export class CrossDomainAuth {
265
266
  }
266
267
  }
267
268
  catch (error) {
268
- console.warn('[CrossDomainAuth] Stored session invalid:', error);
269
+ logger.debug('stored session invalid', { component: 'CrossDomainAuth', method: 'initialize' }, error);
269
270
  }
270
271
  }
271
272
  // 3. Try silent sign-in (check for SSO session at auth.oxy.so)