@oxyhq/core 12.10.0 → 12.10.2
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/HttpService.js +22 -12
- package/dist/cjs/i18n/locales/ar-SA.json +4 -0
- package/dist/cjs/i18n/locales/ca-ES.json +4 -0
- package/dist/cjs/i18n/locales/de-DE.json +4 -0
- package/dist/cjs/i18n/locales/en-US.json +69 -3
- package/dist/cjs/i18n/locales/es-ES.json +68 -2
- package/dist/cjs/i18n/locales/fr-FR.json +4 -0
- package/dist/cjs/i18n/locales/it-IT.json +4 -0
- package/dist/cjs/i18n/locales/ja-JP.json +4 -0
- package/dist/cjs/i18n/locales/ko-KR.json +4 -0
- package/dist/cjs/i18n/locales/locales/ar-SA.json +4 -0
- package/dist/cjs/i18n/locales/locales/ca-ES.json +4 -0
- package/dist/cjs/i18n/locales/locales/de-DE.json +4 -0
- package/dist/cjs/i18n/locales/locales/en-US.json +69 -3
- package/dist/cjs/i18n/locales/locales/es-ES.json +68 -2
- package/dist/cjs/i18n/locales/locales/fr-FR.json +4 -0
- package/dist/cjs/i18n/locales/locales/it-IT.json +4 -0
- package/dist/cjs/i18n/locales/locales/ja-JP.json +4 -0
- package/dist/cjs/i18n/locales/locales/ko-KR.json +4 -0
- package/dist/cjs/i18n/locales/locales/pt-PT.json +4 -0
- package/dist/cjs/i18n/locales/locales/zh-CN.json +4 -0
- package/dist/cjs/i18n/locales/pt-PT.json +4 -0
- package/dist/cjs/i18n/locales/zh-CN.json +4 -0
- package/dist/cjs/mixins/OxyServices.auth.js +47 -19
- package/dist/cjs/mixins/OxyServices.connectedApps.js +6 -1
- package/dist/cjs/mixins/OxyServices.deviceBoot.js +9 -2
- package/dist/cjs/mixins/OxyServices.user.js +2 -0
- package/dist/cjs/session/accountDialogController.js +7 -5
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/HttpService.js +22 -12
- package/dist/esm/i18n/locales/ar-SA.json +4 -0
- package/dist/esm/i18n/locales/ca-ES.json +4 -0
- package/dist/esm/i18n/locales/de-DE.json +4 -0
- package/dist/esm/i18n/locales/en-US.json +69 -3
- package/dist/esm/i18n/locales/es-ES.json +68 -2
- package/dist/esm/i18n/locales/fr-FR.json +4 -0
- package/dist/esm/i18n/locales/it-IT.json +4 -0
- package/dist/esm/i18n/locales/ja-JP.json +4 -0
- package/dist/esm/i18n/locales/ko-KR.json +4 -0
- package/dist/esm/i18n/locales/locales/ar-SA.json +4 -0
- package/dist/esm/i18n/locales/locales/ca-ES.json +4 -0
- package/dist/esm/i18n/locales/locales/de-DE.json +4 -0
- package/dist/esm/i18n/locales/locales/en-US.json +69 -3
- package/dist/esm/i18n/locales/locales/es-ES.json +68 -2
- package/dist/esm/i18n/locales/locales/fr-FR.json +4 -0
- package/dist/esm/i18n/locales/locales/it-IT.json +4 -0
- package/dist/esm/i18n/locales/locales/ja-JP.json +4 -0
- package/dist/esm/i18n/locales/locales/ko-KR.json +4 -0
- package/dist/esm/i18n/locales/locales/pt-PT.json +4 -0
- package/dist/esm/i18n/locales/locales/zh-CN.json +4 -0
- package/dist/esm/i18n/locales/pt-PT.json +4 -0
- package/dist/esm/i18n/locales/zh-CN.json +4 -0
- package/dist/esm/mixins/OxyServices.auth.js +47 -19
- package/dist/esm/mixins/OxyServices.connectedApps.js +6 -1
- package/dist/esm/mixins/OxyServices.deviceBoot.js +9 -2
- package/dist/esm/mixins/OxyServices.user.js +2 -0
- package/dist/esm/session/accountDialogController.js +7 -5
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/HttpService.d.ts +14 -0
- package/dist/types/session/accountDialogController.d.ts +7 -2
- package/package.json +1 -1
- package/src/HttpService.ts +37 -14
- package/src/__tests__/httpServiceAuthSelfAwait.test.ts +108 -0
- package/src/__tests__/httpServiceQueueDeadlock.test.ts +128 -0
- package/src/i18n/locales/ar-SA.json +4 -0
- package/src/i18n/locales/ca-ES.json +4 -0
- package/src/i18n/locales/de-DE.json +4 -0
- package/src/i18n/locales/en-US.json +69 -3
- package/src/i18n/locales/es-ES.json +68 -2
- package/src/i18n/locales/fr-FR.json +4 -0
- package/src/i18n/locales/it-IT.json +4 -0
- package/src/i18n/locales/ja-JP.json +4 -0
- package/src/i18n/locales/ko-KR.json +4 -0
- package/src/i18n/locales/pt-PT.json +4 -0
- package/src/i18n/locales/zh-CN.json +4 -0
- package/src/mixins/OxyServices.auth.ts +39 -19
- package/src/mixins/OxyServices.connectedApps.ts +6 -1
- package/src/mixins/OxyServices.deviceBoot.ts +7 -2
- package/src/mixins/OxyServices.user.ts +2 -0
- package/src/mixins/__tests__/OxyServices.deviceBoot.test.ts +4 -2
- package/src/mixins/__tests__/commonsSignIn.test.ts +4 -4
- package/src/mixins/__tests__/preSessionSkipAuth.test.ts +152 -0
- package/src/mixins/__tests__/webauthnAuth.test.ts +6 -6
- package/src/session/__tests__/accountDialogController.test.ts +3 -3
- package/src/session/accountDialogController.ts +7 -6
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
"accountSwitcher": {
|
|
115
|
+
"sections": {
|
|
116
|
+
"yourAccounts": "내 계정"
|
|
117
|
+
},
|
|
118
|
+
"loading": "계정을 불러오는 중...",
|
|
115
119
|
"qrHeadline": "Oxy ID로 로그인",
|
|
116
120
|
"signInWithOxy": "Oxy로 로그인",
|
|
117
121
|
"useIdentityOnDevice": "Commons가 없으신가요? 이 기기의 패스키를 사용하세요",
|
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
"accountSwitcher": {
|
|
115
|
+
"sections": {
|
|
116
|
+
"yourAccounts": "As suas contas"
|
|
117
|
+
},
|
|
118
|
+
"loading": "A carregar contas...",
|
|
115
119
|
"qrHeadline": "Inicie sessão com a sua identidade Oxy",
|
|
116
120
|
"signInWithOxy": "Iniciar sessão com Oxy",
|
|
117
121
|
"useIdentityOnDevice": "Não tem o Commons? Use uma chave de acesso neste dispositivo",
|
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
"accountSwitcher": {
|
|
115
|
+
"sections": {
|
|
116
|
+
"yourAccounts": "As suas contas"
|
|
117
|
+
},
|
|
118
|
+
"loading": "A carregar contas...",
|
|
115
119
|
"qrHeadline": "Inicie sessão com a sua identidade Oxy",
|
|
116
120
|
"signInWithOxy": "Iniciar sessão com Oxy",
|
|
117
121
|
"useIdentityOnDevice": "Não tem o Commons? Use uma chave de acesso neste dispositivo",
|
|
@@ -189,7 +189,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
189
189
|
* @internal
|
|
190
190
|
*/
|
|
191
191
|
async _doFetchServiceToken(key, secret, cacheKey, secretBuf) {
|
|
192
|
-
const response = await this.makeRequest('POST', '/auth/service-token', { apiKey: key, apiSecret: secret }, { cache: false, retry: false });
|
|
192
|
+
const response = await this.makeRequest('POST', '/auth/service-token', { apiKey: key, apiSecret: secret }, { cache: false, retry: false, skipAuth: true });
|
|
193
193
|
const expiresAt = Date.now() + response.expiresIn * 1000;
|
|
194
194
|
// Update the entry in-place so any caller that already grabbed a reference
|
|
195
195
|
// (via `_serviceTokenCache.get(...)`) sees the fresh state.
|
|
@@ -286,7 +286,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
286
286
|
publicKey,
|
|
287
287
|
signature,
|
|
288
288
|
timestamp,
|
|
289
|
-
}, { cache: false });
|
|
289
|
+
}, { cache: false, skipAuth: true });
|
|
290
290
|
if (!res || (typeof res === 'object' && Object.keys(res).length === 0)) {
|
|
291
291
|
throw new OxyServices_errors_1.OxyAuthenticationError('Registration failed', 'REGISTER_FAILED', 400);
|
|
292
292
|
}
|
|
@@ -310,7 +310,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
310
310
|
try {
|
|
311
311
|
return await this.makeRequest('POST', '/auth/challenge', {
|
|
312
312
|
publicKey,
|
|
313
|
-
}, { cache: false, ...requestOptions });
|
|
313
|
+
}, { cache: false, skipAuth: true, ...requestOptions });
|
|
314
314
|
}
|
|
315
315
|
catch (error) {
|
|
316
316
|
throw this.handleError(error);
|
|
@@ -339,7 +339,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
339
339
|
timestamp,
|
|
340
340
|
deviceName,
|
|
341
341
|
deviceFingerprint,
|
|
342
|
-
}, { cache: false, ...requestOptions });
|
|
342
|
+
}, { cache: false, skipAuth: true, ...requestOptions });
|
|
343
343
|
// Plant the freshly-minted tokens, mirroring `claimSessionByToken`.
|
|
344
344
|
// `/auth/verify` returns the first access token (and refresh token) in
|
|
345
345
|
// its body, so installing it here means callers get an authenticated
|
|
@@ -362,7 +362,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
362
362
|
*/
|
|
363
363
|
async checkPublicKeyRegistered(publicKey) {
|
|
364
364
|
try {
|
|
365
|
-
return await this.makeRequest('GET', `/auth/check-publickey/${encodeURIComponent(publicKey)}`, undefined, { cache: false });
|
|
365
|
+
return await this.makeRequest('GET', `/auth/check-publickey/${encodeURIComponent(publicKey)}`, undefined, { cache: false, skipAuth: true });
|
|
366
366
|
}
|
|
367
367
|
catch (error) {
|
|
368
368
|
throw this.handleError(error);
|
|
@@ -373,7 +373,12 @@ function OxyServicesAuthMixin(Base) {
|
|
|
373
373
|
*/
|
|
374
374
|
async getUserByPublicKey(publicKey) {
|
|
375
375
|
try {
|
|
376
|
-
const user = await this.makeRequest('GET', `/auth/user/${encodeURIComponent(publicKey)}`, undefined, {
|
|
376
|
+
const user = await this.makeRequest('GET', `/auth/user/${encodeURIComponent(publicKey)}`, undefined, {
|
|
377
|
+
cache: true,
|
|
378
|
+
cacheTTL: 2 * 60 * 1000,
|
|
379
|
+
// Public lookup by public key (pre-session) — skip the bearer preflight.
|
|
380
|
+
skipAuth: true,
|
|
381
|
+
});
|
|
377
382
|
return (0, userIdentity_1.normalizeUserIdentity)(user);
|
|
378
383
|
}
|
|
379
384
|
catch (error) {
|
|
@@ -444,7 +449,9 @@ function OxyServicesAuthMixin(Base) {
|
|
|
444
449
|
const res = await this.makeRequest('POST', '/auth/session/claim', {
|
|
445
450
|
sessionToken,
|
|
446
451
|
...(options.deviceFingerprint ? { deviceFingerprint: options.deviceFingerprint } : {}),
|
|
447
|
-
},
|
|
452
|
+
},
|
|
453
|
+
// Body-authenticated device-flow claim (no bearer) — skip the preflight.
|
|
454
|
+
{ cache: false, retry: false, skipAuth: true });
|
|
448
455
|
this.setTokens(res.accessToken);
|
|
449
456
|
return res;
|
|
450
457
|
}
|
|
@@ -528,7 +535,11 @@ function OxyServicesAuthMixin(Base) {
|
|
|
528
535
|
// QR. Reuses the platform-safe random generator.
|
|
529
536
|
const sessionToken = await signatureService_1.SignatureService.generateChallenge();
|
|
530
537
|
const expiresAt = Date.now() + COMMONS_SIGN_IN_EXPIRY_MS;
|
|
531
|
-
const res = await this.makeRequest('POST', '/auth/session/create', { sessionToken, expiresAt, clientId: params.clientId },
|
|
538
|
+
const res = await this.makeRequest('POST', '/auth/session/create', { sessionToken, expiresAt, clientId: params.clientId },
|
|
539
|
+
// Public/pre-session (no bearer): skip the preflight so a stale
|
|
540
|
+
// near-expiry token cannot re-enter refreshAccessToken while the
|
|
541
|
+
// refresh handler is already in flight (self-await hang).
|
|
542
|
+
{ cache: false, skipAuth: true });
|
|
532
543
|
return {
|
|
533
544
|
sessionToken,
|
|
534
545
|
authorizeCode: res.authorizeCode,
|
|
@@ -552,7 +563,11 @@ function OxyServicesAuthMixin(Base) {
|
|
|
552
563
|
*/
|
|
553
564
|
async pollCommonsSignIn(sessionToken) {
|
|
554
565
|
try {
|
|
555
|
-
return await this.makeRequest('GET', `/auth/session/status/${encodeURIComponent(sessionToken)}`, undefined,
|
|
566
|
+
return await this.makeRequest('GET', `/auth/session/status/${encodeURIComponent(sessionToken)}`, undefined,
|
|
567
|
+
// Public/pre-session (no bearer): a preflight here is wrong per se and,
|
|
568
|
+
// if ever reached while a refresh is pending, would re-enter
|
|
569
|
+
// refreshAccessToken and await the very promise it runs inside.
|
|
570
|
+
{ cache: false, retry: false, skipAuth: true });
|
|
556
571
|
}
|
|
557
572
|
catch (error) {
|
|
558
573
|
throw this.handleError(error);
|
|
@@ -570,7 +585,10 @@ function OxyServicesAuthMixin(Base) {
|
|
|
570
585
|
*/
|
|
571
586
|
async getCommonsApprovalInfo(authorizeCode) {
|
|
572
587
|
try {
|
|
573
|
-
const raw = await this.makeRequest('GET', `/auth/session/approve-info/${encodeURIComponent(authorizeCode)}`, undefined,
|
|
588
|
+
const raw = await this.makeRequest('GET', `/auth/session/approve-info/${encodeURIComponent(authorizeCode)}`, undefined,
|
|
589
|
+
// Public (no auth required) — skip the bearer preflight (avoids the
|
|
590
|
+
// pre-session self-await class).
|
|
591
|
+
{ cache: false, skipAuth: true });
|
|
574
592
|
return {
|
|
575
593
|
application: raw.application,
|
|
576
594
|
scopes: raw.scopes,
|
|
@@ -617,7 +635,9 @@ function OxyServicesAuthMixin(Base) {
|
|
|
617
635
|
timestamp: signed.timestamp,
|
|
618
636
|
...(params.deviceName ? { deviceName: params.deviceName } : {}),
|
|
619
637
|
...(params.deviceFingerprint ? { deviceFingerprint: params.deviceFingerprint } : {}),
|
|
620
|
-
},
|
|
638
|
+
},
|
|
639
|
+
// Key-signed, cookieless (no bearer) — skip the preflight.
|
|
640
|
+
{ cache: false, skipAuth: true });
|
|
621
641
|
}
|
|
622
642
|
catch (error) {
|
|
623
643
|
throw this.handleError(error);
|
|
@@ -631,7 +651,9 @@ function OxyServicesAuthMixin(Base) {
|
|
|
631
651
|
*/
|
|
632
652
|
async denyCommonsSignIn(authorizeCode) {
|
|
633
653
|
try {
|
|
634
|
-
return await this.makeRequest('POST', `/auth/session/deny/${encodeURIComponent(authorizeCode)}`, undefined,
|
|
654
|
+
return await this.makeRequest('POST', `/auth/session/deny/${encodeURIComponent(authorizeCode)}`, undefined,
|
|
655
|
+
// Public (no auth required) — skip the bearer preflight.
|
|
656
|
+
{ cache: false, skipAuth: true });
|
|
635
657
|
}
|
|
636
658
|
catch (error) {
|
|
637
659
|
throw this.handleError(error);
|
|
@@ -742,7 +764,8 @@ function OxyServicesAuthMixin(Base) {
|
|
|
742
764
|
*/
|
|
743
765
|
async checkUsernameAvailability(username) {
|
|
744
766
|
try {
|
|
745
|
-
|
|
767
|
+
// Public availability lookup (pre-session) — skip the bearer preflight.
|
|
768
|
+
return await this.makeRequest('GET', `/auth/check-username/${username}`, undefined, { cache: false, skipAuth: true });
|
|
746
769
|
}
|
|
747
770
|
catch (error) {
|
|
748
771
|
throw this.handleError(error);
|
|
@@ -753,7 +776,8 @@ function OxyServicesAuthMixin(Base) {
|
|
|
753
776
|
*/
|
|
754
777
|
async checkEmailAvailability(email) {
|
|
755
778
|
try {
|
|
756
|
-
|
|
779
|
+
// Public availability lookup (pre-session) — skip the bearer preflight.
|
|
780
|
+
return await this.makeRequest('GET', `/auth/check-email/${email}`, undefined, { cache: false, skipAuth: true });
|
|
757
781
|
}
|
|
758
782
|
catch (error) {
|
|
759
783
|
throw this.handleError(error);
|
|
@@ -772,7 +796,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
772
796
|
*/
|
|
773
797
|
async webauthnRegisterOptions(username) {
|
|
774
798
|
try {
|
|
775
|
-
return await this.makeRequest('POST', '/auth/webauthn/register/options', { ...(username !== undefined ? { username } : {}) }, { cache: false });
|
|
799
|
+
return await this.makeRequest('POST', '/auth/webauthn/register/options', { ...(username !== undefined ? { username } : {}) }, { cache: false, ...(username !== undefined ? { skipAuth: true } : {}) });
|
|
776
800
|
}
|
|
777
801
|
catch (error) {
|
|
778
802
|
throw this.handleError(error);
|
|
@@ -793,7 +817,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
793
817
|
*/
|
|
794
818
|
async webauthnRegisterVerify(response, envelope = {}) {
|
|
795
819
|
try {
|
|
796
|
-
const res = await this.makeRequest('POST', '/auth/webauthn/register/verify', { response, ...envelope }, { cache: false });
|
|
820
|
+
const res = await this.makeRequest('POST', '/auth/webauthn/register/verify', { response, ...envelope }, { cache: false, ...(envelope.username !== undefined ? { skipAuth: true } : {}) });
|
|
797
821
|
if (res && typeof res === 'object') {
|
|
798
822
|
const record = res;
|
|
799
823
|
// Signup branch: mints a session (LoginSessionResult, carries
|
|
@@ -831,7 +855,9 @@ function OxyServicesAuthMixin(Base) {
|
|
|
831
855
|
*/
|
|
832
856
|
async webauthnLoginOptions(username) {
|
|
833
857
|
try {
|
|
834
|
-
return await this.makeRequest('POST', '/auth/webauthn/login/options', { ...(username !== undefined ? { username } : {}) },
|
|
858
|
+
return await this.makeRequest('POST', '/auth/webauthn/login/options', { ...(username !== undefined ? { username } : {}) },
|
|
859
|
+
// Pre-session login ceremony — skip the bearer preflight.
|
|
860
|
+
{ cache: false, skipAuth: true });
|
|
835
861
|
}
|
|
836
862
|
catch (error) {
|
|
837
863
|
throw this.handleError(error);
|
|
@@ -847,7 +873,9 @@ function OxyServicesAuthMixin(Base) {
|
|
|
847
873
|
*/
|
|
848
874
|
async webauthnLoginVerify(response, envelope = {}) {
|
|
849
875
|
try {
|
|
850
|
-
const res = await this.makeRequest('POST', '/auth/webauthn/login/verify', { response, ...envelope },
|
|
876
|
+
const res = await this.makeRequest('POST', '/auth/webauthn/login/verify', { response, ...envelope },
|
|
877
|
+
// Pre-session login ceremony — skip the bearer preflight.
|
|
878
|
+
{ cache: false, skipAuth: true });
|
|
851
879
|
const parsed = (0, contracts_1.safeParseContract)(contracts_1.loginResultSchema, res);
|
|
852
880
|
if (!parsed) {
|
|
853
881
|
throw new Error('auth/webauthn/login/verify returned an unexpected response shape');
|
|
@@ -874,7 +902,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
874
902
|
clientId: params.clientId,
|
|
875
903
|
redirectUri: params.redirectUri,
|
|
876
904
|
codeVerifier: params.codeVerifier,
|
|
877
|
-
}, { cache: false });
|
|
905
|
+
}, { cache: false, skipAuth: true });
|
|
878
906
|
const payload = res.data ??
|
|
879
907
|
res;
|
|
880
908
|
if (!payload || typeof payload !== 'object') {
|
|
@@ -19,7 +19,12 @@ function OxyServicesConnectedAppsMixin(Base) {
|
|
|
19
19
|
*/
|
|
20
20
|
async getPublicApplication(clientId) {
|
|
21
21
|
try {
|
|
22
|
-
const res = await this.makeRequest('GET', `/auth/oauth/client/${encodeURIComponent(clientId)}`, undefined, {
|
|
22
|
+
const res = await this.makeRequest('GET', `/auth/oauth/client/${encodeURIComponent(clientId)}`, undefined, {
|
|
23
|
+
cache: true,
|
|
24
|
+
cacheTTL: mixinHelpers_1.CACHE_TIMES.MEDIUM,
|
|
25
|
+
// Public client metadata (pre-session consent UI) — skip the bearer preflight.
|
|
26
|
+
skipAuth: true,
|
|
27
|
+
});
|
|
23
28
|
return res.application;
|
|
24
29
|
}
|
|
25
30
|
catch (error) {
|
|
@@ -44,7 +44,11 @@ function OxyServicesDeviceBootMixin(Base) {
|
|
|
44
44
|
*/
|
|
45
45
|
async mintFromDeviceSecret(deviceId, deviceSecret) {
|
|
46
46
|
try {
|
|
47
|
-
const res = await this.makeRequest('POST', '/session/device/token', { deviceId, deviceSecret },
|
|
47
|
+
const res = await this.makeRequest('POST', '/session/device/token', { deviceId, deviceSecret },
|
|
48
|
+
// `bypassQueue`: this mint is the control-plane call the auth lane
|
|
49
|
+
// depends on — it must run even when every RequestQueue slot is parked
|
|
50
|
+
// awaiting it, or the whole client deadlocks. See RequestOptions.bypassQueue.
|
|
51
|
+
{ cache: false, skipAuth: true, retry: false, bypassQueue: true });
|
|
48
52
|
const parsed = (0, contracts_1.safeParseContract)(contracts_1.deviceTokenMintResponseSchema, res);
|
|
49
53
|
if (!parsed) {
|
|
50
54
|
throw new Error('session/device/token returned an unexpected response shape');
|
|
@@ -72,7 +76,10 @@ function OxyServicesDeviceBootMixin(Base) {
|
|
|
72
76
|
/** Redeem a hub sync ticket for a fresh device secret (public). */
|
|
73
77
|
async redeemHubTicket(ticket, returnOrigin) {
|
|
74
78
|
try {
|
|
75
|
-
const res = await this.makeRequest('POST', '/session/device/redeem-ticket', { ticket, returnOrigin },
|
|
79
|
+
const res = await this.makeRequest('POST', '/session/device/redeem-ticket', { ticket, returnOrigin },
|
|
80
|
+
// Public device-hub sync mint (bearer-less). Same control-plane class as
|
|
81
|
+
// the device-secret mint — bypassQueue so it never waits for a slot.
|
|
82
|
+
{ cache: false, skipAuth: true, bypassQueue: true });
|
|
76
83
|
const parsed = (0, contracts_1.safeParseContract)(contracts_1.deviceHubTicketRedeemResponseSchema, res);
|
|
77
84
|
if (!parsed) {
|
|
78
85
|
throw new Error('session/device/redeem-ticket returned an unexpected response shape');
|
|
@@ -59,6 +59,8 @@ function OxyServicesUserMixin(Base) {
|
|
|
59
59
|
return await this.makeRequest('GET', `/auth/lookup/${encodeURIComponent(username)}`, undefined, {
|
|
60
60
|
cache: true,
|
|
61
61
|
cacheTTL: 60 * 1000, // 1 minute cache
|
|
62
|
+
// Public login-flow lookup (pre-session) — skip the bearer preflight.
|
|
63
|
+
skipAuth: true,
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
/**
|
|
@@ -36,6 +36,13 @@
|
|
|
36
36
|
* password, social login, and 2FA were removed ecosystem-wide. Account
|
|
37
37
|
* creation (`signup` view) is the same two identity backends: a passkey
|
|
38
38
|
* ceremony on web, or a Commons-created identity.
|
|
39
|
+
*
|
|
40
|
+
* The controller owns NO surface PRESENTATION: whether the account dialog is
|
|
41
|
+
* mounted, visible, or dismissed is the job of the shared surface stack
|
|
42
|
+
* (`@oxyhq/services` presents the `AccountDialog` surface into `@oxyhq/bloom`'s
|
|
43
|
+
* stack). This is a headless state machine only — it exposes `setView` /
|
|
44
|
+
* `add` / `startSignup` (the view axis) and `cancelSignIn` (device-flow
|
|
45
|
+
* teardown), never an `open` / `close` / `visible`.
|
|
39
46
|
*/
|
|
40
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
48
|
exports.AccountDialogController = void 0;
|
|
@@ -252,11 +259,6 @@ class AccountDialogController {
|
|
|
252
259
|
this.view = view;
|
|
253
260
|
this.emit();
|
|
254
261
|
}
|
|
255
|
-
/** Return to the account list and cancel any in-flight sign-in flow. */
|
|
256
|
-
close() {
|
|
257
|
-
this.cancelSignIn();
|
|
258
|
-
this.setView('accounts');
|
|
259
|
-
}
|
|
260
262
|
/** Switch to the "add account" view (the sign-in entry chooser). */
|
|
261
263
|
add() {
|
|
262
264
|
this.setView('add');
|