Fix stale login redirect
This commit is contained in:
parent
59f7269930
commit
adc3c8bfe1
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue