fix: authentication race condition (#1319)

This commit is contained in:
Ihor Stuzhuk 2023-11-17 22:24:22 +02:00 committed by GitHub
parent aecf905642
commit 153268f30d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
import PasswordField from '@/components/Core/PasswordField.vue'
import { useAuthStore } from '@/stores/auth'
import { onMounted, reactive, ref } from 'vue'
import { onMounted, reactive, ref, watchEffect } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { toast } from 'vue3-toastify'
import { useI18n } from 'vue-i18n'
@ -52,7 +52,9 @@ onMounted(async () => {
route.query.password as string
)
}
})
watchEffect(() => {
if (authStore.isAuthenticated) {
redirectOnSuccess()
}