@strands.gg/accui 1.3.0 → 1.3.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/nuxt/runtime/composables/useStrandsAuth.cjs.js +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts +1 -0
- package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts.map +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.es.js +1 -1
- package/dist/nuxt/runtime/plugin.client.cjs.js +1 -1
- package/dist/nuxt/runtime/plugin.client.es.js +1 -1
- package/dist/nuxt/runtime/plugin.server.cjs.js +1 -1
- package/dist/nuxt/runtime/plugin.server.es.js +1 -1
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.cjs.js +1 -1
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.es.js +1 -1
- package/dist/nuxt-v4/runtime/plugin.client.cjs.js +1 -1
- package/dist/nuxt-v4/runtime/plugin.client.es.js +1 -1
- package/dist/nuxt-v4/runtime/plugin.server.cjs.js +1 -1
- package/dist/nuxt-v4/runtime/plugin.server.es.js +1 -1
- package/dist/strands-auth-ui.cjs.js +38 -16
- package/dist/strands-auth-ui.cjs.js.map +1 -1
- package/dist/strands-auth-ui.es.js +39 -17
- package/dist/strands-auth-ui.es.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/{useStrandsAuth-DK6bMycB.cjs → useStrandsAuth-Bw5wrBA2.cjs} +30 -4
- package/dist/useStrandsAuth-Bw5wrBA2.cjs.map +1 -0
- package/dist/{useStrandsAuth-DiT3EcHV.js → useStrandsAuth-DQbwHB-6.js} +30 -4
- package/dist/useStrandsAuth-DQbwHB-6.js.map +1 -0
- package/dist/{useStrandsConfig-CjQTmiYi.cjs → useStrandsConfig-B9UkrP-c.cjs} +7 -3
- package/dist/useStrandsConfig-B9UkrP-c.cjs.map +1 -0
- package/dist/{useStrandsConfig-EVnsLNNn.js → useStrandsConfig-V7XSMyQ5.js} +7 -3
- package/dist/useStrandsConfig-V7XSMyQ5.js.map +1 -0
- package/dist/vue/components/StrandsHardwareKeySetupModal.vue.d.ts.map +1 -1
- package/dist/vue/components/StrandsMfaVerification.vue.d.ts.map +1 -1
- package/dist/vue/composables/useStrandsAuth.d.ts +1 -0
- package/dist/vue/composables/useStrandsAuth.d.ts.map +1 -1
- package/dist/vue/composables/useStrandsConfig.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/useStrandsAuth-DK6bMycB.cjs.map +0 -1
- package/dist/useStrandsAuth-DiT3EcHV.js.map +0 -1
- package/dist/useStrandsConfig-CjQTmiYi.cjs.map +0 -1
- package/dist/useStrandsConfig-EVnsLNNn.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, createElementVNode, createCommentVNode, toDisplayString, renderSlot, createTextVNode, useSlots, ref, createBlock, resolveDynamicComponent, mergeProps, withCtx, onMounted, nextTick, toRefs, watch, Fragment, renderList, normalizeStyle, Teleport, withModifiers, createVNode, createSlots, onBeforeUnmount, withKeys, reactive, Transition, h, createStaticVNode } from "vue";
|
|
2
|
-
import { u as useStrandsConfig, p as provideStrandsConfig } from "./useStrandsConfig-
|
|
3
|
-
import { s } from "./useStrandsConfig-
|
|
4
|
-
import { u as useStrandsAuth } from "./useStrandsAuth-
|
|
2
|
+
import { u as useStrandsConfig, p as provideStrandsConfig } from "./useStrandsConfig-V7XSMyQ5.js";
|
|
3
|
+
import { s } from "./useStrandsConfig-V7XSMyQ5.js";
|
|
4
|
+
import { u as useStrandsAuth } from "./useStrandsAuth-DQbwHB-6.js";
|
|
5
5
|
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "UiAlert",
|
|
7
7
|
props: {
|
|
@@ -1247,6 +1247,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1247
1247
|
const {
|
|
1248
1248
|
verifyMfa,
|
|
1249
1249
|
sendMfaEmailCode,
|
|
1250
|
+
getMfaWebAuthnChallenge,
|
|
1250
1251
|
mfaSessionId: authMfaSessionId,
|
|
1251
1252
|
loading: authLoading,
|
|
1252
1253
|
loadingMessage: authLoadingMessage,
|
|
@@ -1326,9 +1327,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1326
1327
|
const onBackupCodeInput = (value) => {
|
|
1327
1328
|
let cleaned = value.replace(/[^a-zA-Z0-9-]/g, "").toLowerCase();
|
|
1328
1329
|
if (!/[-]/.test(cleaned) && cleaned.length > 4) {
|
|
1329
|
-
|
|
1330
|
+
const part1 = cleaned.substring(0, 4);
|
|
1331
|
+
const part2 = cleaned.substring(4, 8);
|
|
1332
|
+
cleaned = part2 ? `${part1}-${part2}` : part1;
|
|
1330
1333
|
}
|
|
1331
|
-
if (cleaned.replace(/-/g, "").length <=
|
|
1334
|
+
if (cleaned.replace(/-/g, "").length <= 8) {
|
|
1332
1335
|
backupCode.value = cleaned;
|
|
1333
1336
|
}
|
|
1334
1337
|
backupCodeError.value = "";
|
|
@@ -1387,16 +1390,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1387
1390
|
if (!window.navigator.credentials || !window.PublicKeyCredential) {
|
|
1388
1391
|
throw new Error("Hardware keys are not supported in this browser");
|
|
1389
1392
|
}
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1393
|
+
const challengeResponse = await getMfaWebAuthnChallenge(selectedMethod.value.id);
|
|
1394
|
+
const challenge = challengeResponse.challenge;
|
|
1395
|
+
console.log("Received WebAuthn challenge:", challenge);
|
|
1392
1396
|
const isPasskey = selectedMethod.value.device_type === "passkey";
|
|
1393
1397
|
const publicKeyCredentialRequestOptions = {
|
|
1394
|
-
challenge,
|
|
1395
|
-
timeout: isPasskey ? 3e5 : 6e4,
|
|
1396
|
-
// Longer timeout for passkeys
|
|
1397
|
-
rpId: window.location.hostname,
|
|
1398
|
-
allowCredentials: [],
|
|
1399
|
-
// Empty to allow any registered credential
|
|
1398
|
+
...challenge,
|
|
1399
|
+
timeout: isPasskey ? 3e5 : challenge.timeout || 6e4,
|
|
1400
1400
|
userVerification: isPasskey ? "required" : "discouraged"
|
|
1401
1401
|
};
|
|
1402
1402
|
const credential = await navigator.credentials.get({
|
|
@@ -1442,7 +1442,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1442
1442
|
emit("error", error instanceof Error ? error.message : "Hardware key authentication failed");
|
|
1443
1443
|
}
|
|
1444
1444
|
};
|
|
1445
|
-
const __returned__ = { props, emit, mfaLoading, getDeviceTypeIcon, getDeviceTypeName, verifyMfa, sendMfaEmailCode, authMfaSessionId, authLoading, authLoadingMessage, isSendingMfaEmail, isVerifyingMfa, loading: loading2, selectedMethod, verificationCode, verificationError, backupCode, backupCodeError, showBackupCodeInput, emailCodeSent, cooldownActive, cooldownSeconds, get cooldownInterval() {
|
|
1445
|
+
const __returned__ = { props, emit, mfaLoading, getDeviceTypeIcon, getDeviceTypeName, verifyMfa, sendMfaEmailCode, getMfaWebAuthnChallenge, authMfaSessionId, authLoading, authLoadingMessage, isSendingMfaEmail, isVerifyingMfa, loading: loading2, selectedMethod, verificationCode, verificationError, backupCode, backupCodeError, showBackupCodeInput, emailCodeSent, cooldownActive, cooldownSeconds, get cooldownInterval() {
|
|
1446
1446
|
return cooldownInterval;
|
|
1447
1447
|
}, set cooldownInterval(v) {
|
|
1448
1448
|
cooldownInterval = v;
|
|
@@ -1846,7 +1846,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1846
1846
|
modelValue: $setup.backupCode,
|
|
1847
1847
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.backupCode = $event),
|
|
1848
1848
|
label: "Backup Code",
|
|
1849
|
-
placeholder: "abcd-
|
|
1849
|
+
placeholder: "abcd-1234",
|
|
1850
1850
|
error: $setup.backupCodeError,
|
|
1851
1851
|
disabled: $setup.loading,
|
|
1852
1852
|
onInput: $setup.onBackupCodeInput,
|
|
@@ -1973,7 +1973,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1973
1973
|
modelValue: $setup.backupCode,
|
|
1974
1974
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.backupCode = $event),
|
|
1975
1975
|
label: "Backup Code",
|
|
1976
|
-
placeholder: "abcd-
|
|
1976
|
+
placeholder: "abcd-1234",
|
|
1977
1977
|
error: $setup.backupCodeError,
|
|
1978
1978
|
disabled: $setup.loading,
|
|
1979
1979
|
onInput: $setup.onBackupCodeInput,
|
|
@@ -7526,6 +7526,28 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
7526
7526
|
const closeModal = () => {
|
|
7527
7527
|
emit("close");
|
|
7528
7528
|
};
|
|
7529
|
+
const getOptimalAuthenticatorSelection = (deviceType) => {
|
|
7530
|
+
if (deviceType === "passkey") {
|
|
7531
|
+
return {
|
|
7532
|
+
authenticatorAttachment: void 0,
|
|
7533
|
+
// Allow both platform and cross-platform for passkeys
|
|
7534
|
+
requireResidentKey: true,
|
|
7535
|
+
// Passkeys are resident credentials
|
|
7536
|
+
residentKey: "required",
|
|
7537
|
+
userVerification: "required"
|
|
7538
|
+
// Passkeys should always verify user
|
|
7539
|
+
};
|
|
7540
|
+
} else {
|
|
7541
|
+
return {
|
|
7542
|
+
authenticatorAttachment: "cross-platform",
|
|
7543
|
+
// Prefer external authenticators like YubiKey
|
|
7544
|
+
requireResidentKey: false,
|
|
7545
|
+
residentKey: "discouraged",
|
|
7546
|
+
userVerification: "discouraged"
|
|
7547
|
+
// YubiKeys work better with discouraged
|
|
7548
|
+
};
|
|
7549
|
+
}
|
|
7550
|
+
};
|
|
7529
7551
|
const createOptimizedWebAuthnChallenge = (challenge, deviceType) => {
|
|
7530
7552
|
const safeBufferConvert = (data) => {
|
|
7531
7553
|
try {
|
|
@@ -7735,7 +7757,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
7735
7757
|
const finish = () => {
|
|
7736
7758
|
emit("success");
|
|
7737
7759
|
};
|
|
7738
|
-
const __returned__ = { props, emit, mfaLoading, registerHardwareKey, completeHardwareKeyRegistration, currentSession, internalLoading, loading: loading2, step, deviceName, deviceNameError, registrationMessage, errorMessage, backupCodes, closeModal, createOptimizedWebAuthnChallenge, startSetup, handleRegisterHardwareKey, copyBackupCodes, finish, get StrandsUiButton() {
|
|
7760
|
+
const __returned__ = { props, emit, mfaLoading, registerHardwareKey, completeHardwareKeyRegistration, currentSession, internalLoading, loading: loading2, step, deviceName, deviceNameError, registrationMessage, errorMessage, backupCodes, closeModal, getOptimalAuthenticatorSelection, createOptimizedWebAuthnChallenge, startSetup, handleRegisterHardwareKey, copyBackupCodes, finish, get StrandsUiButton() {
|
|
7739
7761
|
return StrandsUiButton;
|
|
7740
7762
|
}, get StrandsUiInput() {
|
|
7741
7763
|
return StrandsUiInput;
|