mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 07:05:36 +01:00
Fix callback redirect
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { createApp, ref, onMounted } from 'vue';
|
import { createApp, ref, onMounted } from 'vue';
|
||||||
import { createRouter, createWebHistory, RouterView } from 'vue-router';
|
import { createRouter, createWebHistory, RouterView, useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
|
||||||
const Authorize = {
|
const Authorize = {
|
||||||
@@ -57,13 +57,15 @@ const Main = {
|
|||||||
|
|
||||||
const AuthCallbackTwitch = {
|
const AuthCallbackTwitch = {
|
||||||
setup() {
|
setup() {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetch('/api/auth/callback/twitch/' + window.location.search)
|
fetch('/api/auth/callback/twitch/' + window.location.search)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
localStorage.setItem('token', data.token);
|
localStorage.setItem('token', data.token);
|
||||||
|
|
||||||
this.$router.push('/');
|
router.push('/');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user