Fix stale login redirect

This commit is contained in:
ekzyis 2023-12-03 02:55:27 +01:00
parent 59f7269930
commit adc3c8bfe1
1 changed files with 4 additions and 2 deletions

View File

@ -24,7 +24,7 @@
</template>
<script setup>
import { ref } from 'vue'
import { onUnmounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { useSession } from '@/stores/session'
@ -54,7 +54,7 @@ const poll = async () => {
if (session.isAuthenticated) {
success.value = true
clearInterval(interval)
setInterval(() => {
interval = setInterval(() => {
if (--redirectTimeout.value === 0) {
router.push('/')
}
@ -93,6 +93,8 @@ await (async () => {
})
})()
onUnmounted(() => { clearInterval(interval) })
</script>
<style scoped>