From 500fb294b1f62c579da61853d93e3951aa82f51a Mon Sep 17 00:00:00 2001 From: Gaston Gaiduk Date: Mon, 6 Jan 2025 10:44:53 +0100 Subject: [PATCH 1/3] Access to RA credentials page must be restricted to logged in users --- src/components/RACredentials.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/RACredentials.vue b/src/components/RACredentials.vue index 2608376..d776963 100644 --- a/src/components/RACredentials.vue +++ b/src/components/RACredentials.vue @@ -4,7 +4,7 @@ import {useRouter} from "vue-router"; import {useUserStore} from '../stores/user' import axios from "axios"; -import BurgerMenu from "./BurgerMenu.vue"; +import BurgerMenu from "./_shared/BurgerMenu.vue"; const router = useRouter(); const user = useUserStore(); @@ -49,6 +49,9 @@ async function handleSubmit() { } onMounted(() => { + if (!user.isLoggedIn()) { + router.push("/login"); + } if (user.isSet() && user.username && user.key) { usernameInput.value = user.username; keyInput.value = user.key; From df17f136ea5d9c676e54c79dce0e9c09cb964afd Mon Sep 17 00:00:00 2001 From: Gaston Gaiduk Date: Mon, 6 Jan 2025 10:45:15 +0100 Subject: [PATCH 2/3] Create refresh button component --- src/components/GameLeaderboards.vue | 19 ++----- src/components/Home.vue | 29 ++--------- src/components/LeaderboardEntries.vue | 17 ++---- src/components/LeaderboardsUpdates.vue | 2 +- src/components/{ => _shared}/BurgerMenu.vue | 2 +- src/components/{ => _shared}/ConfirmModal.vue | 0 src/components/_shared/RefreshButton.vue | 52 +++++++++++++++++++ src/components/{ => _shared}/Tooltip.vue | 0 8 files changed, 66 insertions(+), 55 deletions(-) rename src/components/{ => _shared}/BurgerMenu.vue (98%) rename src/components/{ => _shared}/ConfirmModal.vue (100%) create mode 100644 src/components/_shared/RefreshButton.vue rename src/components/{ => _shared}/Tooltip.vue (100%) diff --git a/src/components/GameLeaderboards.vue b/src/components/GameLeaderboards.vue index 0f12069..af51587 100644 --- a/src/components/GameLeaderboards.vue +++ b/src/components/GameLeaderboards.vue @@ -10,8 +10,8 @@ import {useUserStore} from '../stores/user'; import {useGamesStore} from "../stores/games"; import {Game} from "../models/RecentlyPlayedGames.ts"; import {supabase} from "../utils/supabaseClient.ts"; -import Tooltip from "./Tooltip.vue"; -import ConfirmModal from "./ConfirmModal.vue"; +import ConfirmModal from "./_shared/ConfirmModal.vue"; +import RefreshButton from "./_shared/RefreshButton.vue"; const router = useRouter(); const postStore = usePostStore(); @@ -147,12 +147,7 @@ onMounted(async () => {