@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
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const app = require("nuxt/app");
|
|
4
|
-
const useStrandsAuth$1 = require("../../../useStrandsAuth-
|
|
4
|
+
const useStrandsAuth$1 = require("../../../useStrandsAuth-Bw5wrBA2.cjs");
|
|
5
5
|
const useStrandsAuth = () => {
|
|
6
6
|
const config = app.useRuntimeConfig().public["strandsAuth"];
|
|
7
7
|
const vueAuth = useStrandsAuth$1.useStrandsAuth();
|
|
@@ -81,6 +81,7 @@ export declare const useStrandsAuth: () => {
|
|
|
81
81
|
setAuthData: (authResponse: import('../../..').AuthResponse) => void;
|
|
82
82
|
verifyMfa: (deviceId: string, code: string, isBackupCode?: boolean) => Promise<import('../../..').AuthResponse>;
|
|
83
83
|
sendMfaEmailCode: (deviceId: string) => Promise<any>;
|
|
84
|
+
getMfaWebAuthnChallenge: (deviceId: string) => Promise<any>;
|
|
84
85
|
registerHardwareKey: (deviceName: string, accessToken: string, deviceType?: "hardware" | "passkey") => Promise<any>;
|
|
85
86
|
completeHardwareKeyRegistration: (deviceId: string, credential: any, accessToken: string) => Promise<any>;
|
|
86
87
|
startTokenRefreshTimer: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStrandsAuth.d.ts","sourceRoot":"","sources":["../../../../../../apps/accounts-ui/src/nuxt/runtime/composables/useStrandsAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,eAAO,MAAM,cAAc;;0BAYU;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;uBAYtC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE
|
|
1
|
+
{"version":3,"file":"useStrandsAuth.d.ts","sourceRoot":"","sources":["../../../../../../apps/accounts-ui/src/nuxt/runtime/composables/useStrandsAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,eAAO,MAAM,cAAc;;0BAYU;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;uBAYtC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqClD,CAAA;AAGD,eAAO,MAAM,WAAW,QAAO;IAAE,IAAI,EAAE,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;CAG9D,CAAA;AAED,eAAO,MAAM,YAAY,QAAO;IAAE,eAAe,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAGvG,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRuntimeConfig, navigateTo } from "nuxt/app";
|
|
2
|
-
import { u as useStrandsAuth$1 } from "../../../useStrandsAuth-
|
|
2
|
+
import { u as useStrandsAuth$1 } from "../../../useStrandsAuth-DQbwHB-6.js";
|
|
3
3
|
const useStrandsAuth = () => {
|
|
4
4
|
const config = useRuntimeConfig().public["strandsAuth"];
|
|
5
5
|
const vueAuth = useStrandsAuth$1();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const app = require("nuxt/app");
|
|
3
|
-
const useStrandsConfig = require("../../useStrandsConfig-
|
|
3
|
+
const useStrandsConfig = require("../../useStrandsConfig-B9UkrP-c.cjs");
|
|
4
4
|
const plugin_client = app.defineNuxtPlugin({
|
|
5
5
|
name: "strands-auth-client",
|
|
6
6
|
async setup() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRuntimeConfig } from "nuxt/app";
|
|
2
|
-
import { p as provideStrandsConfig, S as STRANDS_AUTH_DEFAULTS } from "../../useStrandsConfig-
|
|
2
|
+
import { p as provideStrandsConfig, S as STRANDS_AUTH_DEFAULTS } from "../../useStrandsConfig-V7XSMyQ5.js";
|
|
3
3
|
const plugin_client = defineNuxtPlugin({
|
|
4
4
|
name: "strands-auth-client",
|
|
5
5
|
async setup() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const app = require("nuxt/app");
|
|
3
|
-
const useStrandsConfig = require("../../useStrandsConfig-
|
|
3
|
+
const useStrandsConfig = require("../../useStrandsConfig-B9UkrP-c.cjs");
|
|
4
4
|
const plugin_server = app.defineNuxtPlugin({
|
|
5
5
|
name: "strands-auth-server",
|
|
6
6
|
setup() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRuntimeConfig } from "nuxt/app";
|
|
2
|
-
import { p as provideStrandsConfig, S as STRANDS_AUTH_DEFAULTS } from "../../useStrandsConfig-
|
|
2
|
+
import { p as provideStrandsConfig, S as STRANDS_AUTH_DEFAULTS } from "../../useStrandsConfig-V7XSMyQ5.js";
|
|
3
3
|
const plugin_server = defineNuxtPlugin({
|
|
4
4
|
name: "strands-auth-server",
|
|
5
5
|
setup() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const app = require("nuxt/app");
|
|
4
|
-
const useStrandsAuth$1 = require("../../../useStrandsAuth-
|
|
4
|
+
const useStrandsAuth$1 = require("../../../useStrandsAuth-Bw5wrBA2.cjs");
|
|
5
5
|
const useStrandsAuth = () => {
|
|
6
6
|
const config = app.useRuntimeConfig().public["strandsAuth"];
|
|
7
7
|
const vueAuth = useStrandsAuth$1.useStrandsAuth();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRuntimeConfig, navigateTo } from "nuxt/app";
|
|
2
|
-
import { u as useStrandsAuth$1 } from "../../../useStrandsAuth-
|
|
2
|
+
import { u as useStrandsAuth$1 } from "../../../useStrandsAuth-DQbwHB-6.js";
|
|
3
3
|
const useStrandsAuth = () => {
|
|
4
4
|
const config = useRuntimeConfig().public["strandsAuth"];
|
|
5
5
|
const vueAuth = useStrandsAuth$1();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const app = require("nuxt/app");
|
|
3
|
-
const useStrandsConfig = require("../../useStrandsConfig-
|
|
3
|
+
const useStrandsConfig = require("../../useStrandsConfig-B9UkrP-c.cjs");
|
|
4
4
|
const plugin_client = app.defineNuxtPlugin({
|
|
5
5
|
name: "strands-auth-client-v4",
|
|
6
6
|
async setup() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRuntimeConfig } from "nuxt/app";
|
|
2
|
-
import { p as provideStrandsConfig, S as STRANDS_AUTH_DEFAULTS } from "../../useStrandsConfig-
|
|
2
|
+
import { p as provideStrandsConfig, S as STRANDS_AUTH_DEFAULTS } from "../../useStrandsConfig-V7XSMyQ5.js";
|
|
3
3
|
const plugin_client = defineNuxtPlugin({
|
|
4
4
|
name: "strands-auth-client-v4",
|
|
5
5
|
async setup() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const app = require("nuxt/app");
|
|
3
|
-
const useStrandsConfig = require("../../useStrandsConfig-
|
|
3
|
+
const useStrandsConfig = require("../../useStrandsConfig-B9UkrP-c.cjs");
|
|
4
4
|
const plugin_server = app.defineNuxtPlugin({
|
|
5
5
|
name: "strands-auth-server-v4",
|
|
6
6
|
setup() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRuntimeConfig } from "nuxt/app";
|
|
2
|
-
import { S as STRANDS_AUTH_DEFAULTS, p as provideStrandsConfig } from "../../useStrandsConfig-
|
|
2
|
+
import { S as STRANDS_AUTH_DEFAULTS, p as provideStrandsConfig } from "../../useStrandsConfig-V7XSMyQ5.js";
|
|
3
3
|
const plugin_server = defineNuxtPlugin({
|
|
4
4
|
name: "strands-auth-server-v4",
|
|
5
5
|
setup() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const useStrandsConfig = require("./useStrandsConfig-
|
|
5
|
-
const useStrandsAuth = require("./useStrandsAuth-
|
|
4
|
+
const useStrandsConfig = require("./useStrandsConfig-B9UkrP-c.cjs");
|
|
5
|
+
const useStrandsAuth = require("./useStrandsAuth-Bw5wrBA2.cjs");
|
|
6
6
|
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
7
7
|
__name: "UiAlert",
|
|
8
8
|
props: {
|
|
@@ -1248,6 +1248,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
1248
1248
|
const {
|
|
1249
1249
|
verifyMfa,
|
|
1250
1250
|
sendMfaEmailCode,
|
|
1251
|
+
getMfaWebAuthnChallenge,
|
|
1251
1252
|
mfaSessionId: authMfaSessionId,
|
|
1252
1253
|
loading: authLoading,
|
|
1253
1254
|
loadingMessage: authLoadingMessage,
|
|
@@ -1327,9 +1328,11 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
1327
1328
|
const onBackupCodeInput = (value) => {
|
|
1328
1329
|
let cleaned = value.replace(/[^a-zA-Z0-9-]/g, "").toLowerCase();
|
|
1329
1330
|
if (!/[-]/.test(cleaned) && cleaned.length > 4) {
|
|
1330
|
-
|
|
1331
|
+
const part1 = cleaned.substring(0, 4);
|
|
1332
|
+
const part2 = cleaned.substring(4, 8);
|
|
1333
|
+
cleaned = part2 ? `${part1}-${part2}` : part1;
|
|
1331
1334
|
}
|
|
1332
|
-
if (cleaned.replace(/-/g, "").length <=
|
|
1335
|
+
if (cleaned.replace(/-/g, "").length <= 8) {
|
|
1333
1336
|
backupCode.value = cleaned;
|
|
1334
1337
|
}
|
|
1335
1338
|
backupCodeError.value = "";
|
|
@@ -1388,16 +1391,13 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
1388
1391
|
if (!window.navigator.credentials || !window.PublicKeyCredential) {
|
|
1389
1392
|
throw new Error("Hardware keys are not supported in this browser");
|
|
1390
1393
|
}
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1394
|
+
const challengeResponse = await getMfaWebAuthnChallenge(selectedMethod.value.id);
|
|
1395
|
+
const challenge = challengeResponse.challenge;
|
|
1396
|
+
console.log("Received WebAuthn challenge:", challenge);
|
|
1393
1397
|
const isPasskey = selectedMethod.value.device_type === "passkey";
|
|
1394
1398
|
const publicKeyCredentialRequestOptions = {
|
|
1395
|
-
challenge,
|
|
1396
|
-
timeout: isPasskey ? 3e5 : 6e4,
|
|
1397
|
-
// Longer timeout for passkeys
|
|
1398
|
-
rpId: window.location.hostname,
|
|
1399
|
-
allowCredentials: [],
|
|
1400
|
-
// Empty to allow any registered credential
|
|
1399
|
+
...challenge,
|
|
1400
|
+
timeout: isPasskey ? 3e5 : challenge.timeout || 6e4,
|
|
1401
1401
|
userVerification: isPasskey ? "required" : "discouraged"
|
|
1402
1402
|
};
|
|
1403
1403
|
const credential = await navigator.credentials.get({
|
|
@@ -1443,7 +1443,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
1443
1443
|
emit("error", error instanceof Error ? error.message : "Hardware key authentication failed");
|
|
1444
1444
|
}
|
|
1445
1445
|
};
|
|
1446
|
-
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() {
|
|
1446
|
+
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() {
|
|
1447
1447
|
return cooldownInterval;
|
|
1448
1448
|
}, set cooldownInterval(v) {
|
|
1449
1449
|
cooldownInterval = v;
|
|
@@ -1847,7 +1847,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1847
1847
|
modelValue: $setup.backupCode,
|
|
1848
1848
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.backupCode = $event),
|
|
1849
1849
|
label: "Backup Code",
|
|
1850
|
-
placeholder: "abcd-
|
|
1850
|
+
placeholder: "abcd-1234",
|
|
1851
1851
|
error: $setup.backupCodeError,
|
|
1852
1852
|
disabled: $setup.loading,
|
|
1853
1853
|
onInput: $setup.onBackupCodeInput,
|
|
@@ -1974,7 +1974,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1974
1974
|
modelValue: $setup.backupCode,
|
|
1975
1975
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.backupCode = $event),
|
|
1976
1976
|
label: "Backup Code",
|
|
1977
|
-
placeholder: "abcd-
|
|
1977
|
+
placeholder: "abcd-1234",
|
|
1978
1978
|
error: $setup.backupCodeError,
|
|
1979
1979
|
disabled: $setup.loading,
|
|
1980
1980
|
onInput: $setup.onBackupCodeInput,
|
|
@@ -7527,6 +7527,28 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
7527
7527
|
const closeModal = () => {
|
|
7528
7528
|
emit("close");
|
|
7529
7529
|
};
|
|
7530
|
+
const getOptimalAuthenticatorSelection = (deviceType) => {
|
|
7531
|
+
if (deviceType === "passkey") {
|
|
7532
|
+
return {
|
|
7533
|
+
authenticatorAttachment: void 0,
|
|
7534
|
+
// Allow both platform and cross-platform for passkeys
|
|
7535
|
+
requireResidentKey: true,
|
|
7536
|
+
// Passkeys are resident credentials
|
|
7537
|
+
residentKey: "required",
|
|
7538
|
+
userVerification: "required"
|
|
7539
|
+
// Passkeys should always verify user
|
|
7540
|
+
};
|
|
7541
|
+
} else {
|
|
7542
|
+
return {
|
|
7543
|
+
authenticatorAttachment: "cross-platform",
|
|
7544
|
+
// Prefer external authenticators like YubiKey
|
|
7545
|
+
requireResidentKey: false,
|
|
7546
|
+
residentKey: "discouraged",
|
|
7547
|
+
userVerification: "discouraged"
|
|
7548
|
+
// YubiKeys work better with discouraged
|
|
7549
|
+
};
|
|
7550
|
+
}
|
|
7551
|
+
};
|
|
7530
7552
|
const createOptimizedWebAuthnChallenge = (challenge, deviceType) => {
|
|
7531
7553
|
const safeBufferConvert = (data) => {
|
|
7532
7554
|
try {
|
|
@@ -7736,7 +7758,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
7736
7758
|
const finish = () => {
|
|
7737
7759
|
emit("success");
|
|
7738
7760
|
};
|
|
7739
|
-
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() {
|
|
7761
|
+
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() {
|
|
7740
7762
|
return StrandsUiButton;
|
|
7741
7763
|
}, get StrandsUiInput() {
|
|
7742
7764
|
return StrandsUiInput;
|