@oxyhq/core 1.11.8 → 1.11.9
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 +4 -11
- package/dist/cjs/mixins/OxyServices.popup.js +5 -9
- package/dist/cjs/mixins/OxyServices.redirect.js +1 -5
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/mixins/OxyServices.fedcm.js +4 -11
- package/dist/esm/mixins/OxyServices.popup.js +5 -9
- package/dist/esm/mixins/OxyServices.redirect.js +1 -5
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/mixins/OxyServices.fedcm.d.ts +0 -3
- package/dist/types/mixins/OxyServices.popup.d.ts +0 -2
- package/dist/types/mixins/OxyServices.redirect.d.ts +0 -2
- package/package.json +1 -1
- package/src/mixins/OxyServices.fedcm.ts +4 -12
- package/src/mixins/OxyServices.popup.ts +5 -10
- package/src/mixins/OxyServices.redirect.ts +1 -6
|
@@ -38,12 +38,6 @@ function OxyServicesFedCMMixin(Base) {
|
|
|
38
38
|
constructor(...args) {
|
|
39
39
|
super(...args);
|
|
40
40
|
}
|
|
41
|
-
/** Resolved FedCM config URL: derived from config.authWebUrl or uses the static default */
|
|
42
|
-
get fedcmConfigUrl() {
|
|
43
|
-
return this.config.authWebUrl
|
|
44
|
-
? `${this.config.authWebUrl}/fedcm.json`
|
|
45
|
-
: this.constructor.DEFAULT_CONFIG_URL;
|
|
46
|
-
}
|
|
47
41
|
/**
|
|
48
42
|
* Check if FedCM is supported in the current browser
|
|
49
43
|
*/
|
|
@@ -95,7 +89,7 @@ function OxyServicesFedCMMixin(Base) {
|
|
|
95
89
|
// Request credential from browser's native identity flow
|
|
96
90
|
// mode: 'button' signals this is a user-gesture-initiated flow (Chrome 125+)
|
|
97
91
|
const credential = await this.requestIdentityCredential({
|
|
98
|
-
configURL: this.
|
|
92
|
+
configURL: (this.config.authWebUrl ? `${this.config.authWebUrl}/fedcm.json` : this.constructor.DEFAULT_CONFIG_URL),
|
|
99
93
|
clientId,
|
|
100
94
|
nonce,
|
|
101
95
|
context: options.context,
|
|
@@ -185,7 +179,7 @@ function OxyServicesFedCMMixin(Base) {
|
|
|
185
179
|
const nonce = this.generateNonce();
|
|
186
180
|
debug.log('Silent SSO: Attempting silent mediation...', loginHint ? `(hint: ${loginHint})` : '');
|
|
187
181
|
credential = await this.requestIdentityCredential({
|
|
188
|
-
configURL: this.
|
|
182
|
+
configURL: (this.config.authWebUrl ? `${this.config.authWebUrl}/fedcm.json` : this.constructor.DEFAULT_CONFIG_URL),
|
|
189
183
|
clientId,
|
|
190
184
|
nonce,
|
|
191
185
|
loginHint,
|
|
@@ -399,7 +393,7 @@ function OxyServicesFedCMMixin(Base) {
|
|
|
399
393
|
if ('IdentityCredential' in window && 'disconnect' in window.IdentityCredential) {
|
|
400
394
|
const clientId = this.getClientId();
|
|
401
395
|
await window.IdentityCredential.disconnect({
|
|
402
|
-
configURL: this.
|
|
396
|
+
configURL: (this.config.authWebUrl ? `${this.config.authWebUrl}/fedcm.json` : this.constructor.DEFAULT_CONFIG_URL),
|
|
403
397
|
clientId,
|
|
404
398
|
accountHint: accountHint || '*',
|
|
405
399
|
});
|
|
@@ -418,7 +412,7 @@ function OxyServicesFedCMMixin(Base) {
|
|
|
418
412
|
getFedCMConfig() {
|
|
419
413
|
return {
|
|
420
414
|
enabled: this.isFedCMSupported(),
|
|
421
|
-
configURL: this.
|
|
415
|
+
configURL: (this.config.authWebUrl ? `${this.config.authWebUrl}/fedcm.json` : this.constructor.DEFAULT_CONFIG_URL),
|
|
422
416
|
clientId: this.getClientId(),
|
|
423
417
|
};
|
|
424
418
|
}
|
|
@@ -483,7 +477,6 @@ function OxyServicesFedCMMixin(Base) {
|
|
|
483
477
|
}
|
|
484
478
|
}
|
|
485
479
|
},
|
|
486
|
-
_a.DEFAULT_AUTH_URL = 'https://auth.oxy.so',
|
|
487
480
|
_a.DEFAULT_CONFIG_URL = 'https://auth.oxy.so/fedcm.json',
|
|
488
481
|
_a.FEDCM_TIMEOUT = 15000 // 15 seconds for interactive
|
|
489
482
|
,
|
|
@@ -33,10 +33,6 @@ function OxyServicesPopupAuthMixin(Base) {
|
|
|
33
33
|
constructor(...args) {
|
|
34
34
|
super(...args);
|
|
35
35
|
}
|
|
36
|
-
/** Resolved auth URL: config.authWebUrl takes precedence over the static default */
|
|
37
|
-
get authUrl() {
|
|
38
|
-
return this.config.authWebUrl || this.constructor.DEFAULT_AUTH_URL;
|
|
39
|
-
}
|
|
40
36
|
/**
|
|
41
37
|
* Sign in using popup window
|
|
42
38
|
*
|
|
@@ -79,7 +75,7 @@ function OxyServicesPopupAuthMixin(Base) {
|
|
|
79
75
|
state,
|
|
80
76
|
nonce,
|
|
81
77
|
clientId: window.location.origin,
|
|
82
|
-
redirectUri: `${this.
|
|
78
|
+
redirectUri: `${(this.config.authWebUrl || this.constructor.DEFAULT_AUTH_URL)}/auth/callback`,
|
|
83
79
|
});
|
|
84
80
|
const popup = this.openCenteredPopup(authUrl, 'Oxy Sign In', width, height);
|
|
85
81
|
if (!popup) {
|
|
@@ -167,7 +163,7 @@ function OxyServicesPopupAuthMixin(Base) {
|
|
|
167
163
|
iframe.style.width = '0';
|
|
168
164
|
iframe.style.height = '0';
|
|
169
165
|
iframe.style.border = 'none';
|
|
170
|
-
const silentUrl = `${this.
|
|
166
|
+
const silentUrl = `${(this.config.authWebUrl || this.constructor.DEFAULT_AUTH_URL)}/auth/silent?` + `client_id=${encodeURIComponent(clientId)}&` + `nonce=${nonce}`;
|
|
171
167
|
iframe.src = silentUrl;
|
|
172
168
|
document.body.appendChild(iframe);
|
|
173
169
|
try {
|
|
@@ -218,7 +214,7 @@ function OxyServicesPopupAuthMixin(Base) {
|
|
|
218
214
|
reject(new OxyServices_errors_1.OxyAuthenticationError('Authentication timeout'));
|
|
219
215
|
}, timeout);
|
|
220
216
|
const messageHandler = (event) => {
|
|
221
|
-
const authUrl = this.
|
|
217
|
+
const authUrl = (this.config.authWebUrl || this.constructor.DEFAULT_AUTH_URL);
|
|
222
218
|
// Log all messages for debugging
|
|
223
219
|
if (event.data && typeof event.data === 'object' && event.data.type) {
|
|
224
220
|
debug.log('Message received:', {
|
|
@@ -290,7 +286,7 @@ function OxyServicesPopupAuthMixin(Base) {
|
|
|
290
286
|
}, timeout);
|
|
291
287
|
const messageHandler = (event) => {
|
|
292
288
|
// Verify origin
|
|
293
|
-
if (event.origin !== this.
|
|
289
|
+
if (event.origin !== (this.config.authWebUrl || this.constructor.DEFAULT_AUTH_URL)) {
|
|
294
290
|
return;
|
|
295
291
|
}
|
|
296
292
|
const { type, session } = event.data;
|
|
@@ -313,7 +309,7 @@ function OxyServicesPopupAuthMixin(Base) {
|
|
|
313
309
|
* @private
|
|
314
310
|
*/
|
|
315
311
|
buildAuthUrl(params) {
|
|
316
|
-
const url = new URL(`${this.
|
|
312
|
+
const url = new URL(`${(this.config.authWebUrl || this.constructor.DEFAULT_AUTH_URL)}/${params.mode}`);
|
|
317
313
|
url.searchParams.set('response_type', 'token');
|
|
318
314
|
url.searchParams.set('client_id', params.clientId);
|
|
319
315
|
url.searchParams.set('redirect_uri', params.redirectUri);
|
|
@@ -33,10 +33,6 @@ function OxyServicesRedirectAuthMixin(Base) {
|
|
|
33
33
|
constructor(...args) {
|
|
34
34
|
super(...args);
|
|
35
35
|
}
|
|
36
|
-
/** Resolved auth URL: config.authWebUrl takes precedence over the static default */
|
|
37
|
-
get authUrl() {
|
|
38
|
-
return this.config.authWebUrl || this.constructor.DEFAULT_AUTH_URL;
|
|
39
|
-
}
|
|
40
36
|
/**
|
|
41
37
|
* Sign in using full page redirect
|
|
42
38
|
*
|
|
@@ -232,7 +228,7 @@ function OxyServicesRedirectAuthMixin(Base) {
|
|
|
232
228
|
* @private
|
|
233
229
|
*/
|
|
234
230
|
buildAuthUrl(params) {
|
|
235
|
-
const url = new URL(`${this.
|
|
231
|
+
const url = new URL(`${(this.config.authWebUrl || this.constructor.DEFAULT_AUTH_URL)}/${params.mode}`);
|
|
236
232
|
url.searchParams.set('redirect_uri', params.redirectUri);
|
|
237
233
|
url.searchParams.set('state', params.state);
|
|
238
234
|
url.searchParams.set('nonce', params.nonce);
|