Skip to content

Commit 2c13a95

Browse files
authored
Fix webauthn not showing up (#2858)
1 parent 0b6ac75 commit 2c13a95

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

resources/js/components/modals/WebauthnModal.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<template>
2-
<Dialog v-model:visible="visible" modal pt:root:class="border-none" pt:mask:style="backdrop-filter: blur(2px)" v-if="!isWebAuthnUnavailable">
2+
<Dialog
3+
v-model:visible="is_webauthn_open"
4+
modal
5+
pt:root:class="border-none"
6+
pt:mask:style="backdrop-filter: blur(2px)"
7+
v-if="!isWebAuthnUnavailable"
8+
>
39
<template #container="{ closeCallback }">
410
<form v-focustrap class="flex flex-col gap-4 relative max-w-full text-sm rounded-md pt-9">
511
<div class="inline-flex flex-col gap-2 px-9">
@@ -30,15 +36,19 @@ import InputText from "../forms/basic/InputText.vue";
3036
import { trans } from "laravel-vue-i18n";
3137
import WebAuthnService from "@/services/webauthn-service";
3238
import { useAuthStore } from "@/stores/Auth";
39+
import { useTogglablesStateStore } from "@/stores/ModalsState";
3340
import AlbumService from "@/services/album-service";
41+
import { storeToRefs } from "pinia";
3442
3543
const toast = useToast();
36-
const visible = defineModel("visible", { default: false }) as Ref<boolean>;
3744
const emits = defineEmits<{
3845
"logged-in": [];
3946
}>();
4047
48+
const togglableStore = useTogglablesStateStore();
49+
4150
const isWebAuthnUnavailable = computed<boolean>(() => WebAuthnService.isWebAuthnUnavailable());
51+
const { is_webauthn_open } = storeToRefs(togglableStore);
4252
4353
const authStore = useAuthStore();
4454
const username = ref("");
@@ -52,7 +62,7 @@ function login() {
5262
summary: trans("lychee.U2F_AUTHENTIFICATION_SUCCESS"),
5363
life: 3000,
5464
});
55-
visible.value = false;
65+
is_webauthn_open.value = false;
5666
authStore.setUser(null);
5767
AlbumService.clearCache();
5868
emits("logged-in");

0 commit comments

Comments
 (0)