Fix callback redirect

This commit is contained in:
2025-01-12 00:16:31 +01:00
parent 8551327bf0
commit 9dfaa38aa5

View File

@@ -1,5 +1,5 @@
import { createApp, ref, onMounted } from 'vue';
import { createRouter, createWebHistory, RouterView } from 'vue-router';
import { createRouter, createWebHistory, RouterView, useRouter } from 'vue-router';
const Authorize = {
@@ -57,13 +57,15 @@ const Main = {
const AuthCallbackTwitch = {
setup() {
const router = useRouter();
onMounted(() => {
fetch('/api/auth/callback/twitch/' + window.location.search)
.then(response => response.json())
.then(data => {
localStorage.setItem('token', data.token);
this.$router.push('/');
router.push('/');
});
});
},