Skip to content

Commit aec2287

Browse files
committed
fix: fix fetching list of existing passkeys
1 parent abef7b9 commit aec2287

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

custom/TwoFactorsPasskeysSettings.vue

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,10 @@
176176
import utc from 'dayjs/plugin/utc';
177177
import timezone from 'dayjs/plugin/timezone';
178178
import { useCoreStore } from '@/stores/core';
179-
import { useUserStore } from '@/stores/user'
180179
181180
dayjs.extend(utc);
182181
dayjs.extend(timezone);
183182
const coreStore = useCoreStore();
184-
const userStore = useUserStore();
185183
const passkeys = ref([]);
186184
const isPasskeySupported = ref(false);
187185
const passkeysNewName = ref('');
@@ -204,14 +202,12 @@
204202
const fetchedOptions = ref(null);
205203
206204
onMounted(async () => {
207-
if (userStore.isAuthorized === true ) {
208-
await getPasskeys();
209-
await checkForCompatibility();
210-
if (authenticatorAttachment.value === "cross-platform") {
211-
addPasskeyMode.value = 'cross-platform';
212-
}
213-
isInitialFinished.value = true;
214-
}
205+
await getPasskeys();
206+
await checkForCompatibility();
207+
if (authenticatorAttachment.value === "cross-platform") {
208+
addPasskeyMode.value = 'cross-platform';
209+
}
210+
isInitialFinished.value = true;
215211
});
216212
217213
onMounted(() => {
@@ -276,7 +272,9 @@
276272
authenticatorAttachment.value = response.authenticatorAttachment;
277273
} catch (error) {
278274
console.error('Error fetching passkeys:', error);
279-
adminforth.alert({message: 'Error fetching passkeys.', variant: 'warning'});
275+
if ( coreStore.adminUser.username ) {
276+
adminforth.alert({message: 'Error fetching passkeys.', variant: 'warning'});
277+
}
280278
}
281279
}
282280

0 commit comments

Comments
 (0)