Fix : switch to state based shuffle animation

This commit is contained in:
2024-07-04 22:07:48 +02:00
parent 25cf8a55e9
commit b1a874aaeb
11 changed files with 97 additions and 232 deletions
+13 -10
View File
@@ -2,21 +2,23 @@ import { useAuthStore } from "#imports";
export default defineNuxtRouteMiddleware(async (to, from) => {
const authStore = useAuthStore();
const config = useRuntimeConfig();
if (to.path == "/login") {
const code = to.query.code;
if (code) {
if (!Array.isArray(code)) {
try {
await authStore.whoami();
return navigateTo("/lobby");
} catch {
return navigateTo("/login");
}
} else {
if (!code) {
return navigateTo(config.public.discordLoginEndpoint, { external: true });
}
if (!Array.isArray(code)) {
try {
await authStore.whoami();
return navigateTo("/lobby");
} catch {
return navigateTo("/login");
}
} else {
return navigateTo("/login");
}
return navigateTo("/lobby");
}
// if (to.path == '/') {
@@ -69,4 +71,5 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
if (to.path !== "/") {
return navigateTo("/");
}
return navigateTo("/lobby");
});