Skip to content

Commit 1fed6e9

Browse files
authored
Import missing router in Login form component
1 parent d9b05a2 commit 1fed6e9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

assets/vue/components/Login.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
/>
2929
</div>
3030

31-
<div v-if="requires2FA" class="field">
31+
<div
32+
v-if="requires2FA"
33+
class="field"
34+
>
3235
<InputText
3336
v-model="totp"
3437
:placeholder="t('Enter 2FA code')"
@@ -82,6 +85,7 @@
8285

8386
<script setup>
8487
import { computed, ref } from "vue"
88+
import { useRouter } from "vue-router"
8589
import Button from "primevue/button"
8690
import InputText from "primevue/inputtext"
8791
import Password from "primevue/password"
@@ -92,6 +96,9 @@ import LoginOAuth2Buttons from "./login/LoginOAuth2Buttons.vue"
9296
import { usePlatformConfig } from "../store/platformConfig"
9397
9498
const { t } = useI18n()
99+
100+
const router = useRouter()
101+
95102
const platformConfigStore = usePlatformConfig()
96103
const allowRegistration = computed(() => "false" !== platformConfigStore.getSetting("registration.allow_registration"))
97104
@@ -116,7 +123,7 @@ async function onSubmitLoginForm() {
116123
if (response.requires2FA) {
117124
requires2FA.value = true
118125
} else {
119-
router.replace({ name: "Home" })
126+
await router.replace({ name: "Home" })
120127
}
121128
}
122129
</script>

0 commit comments

Comments
 (0)