From a10e2217a68c0465264b65ce3d10832f9155c568 Mon Sep 17 00:00:00 2001 From: Trenton Zimmer <66042448+trmazi@users.noreply.github.com> Date: Sun, 5 Jan 2025 15:32:15 -0500 Subject: [PATCH] Add in more greetings, finish remote integrations. --- .env.development | 4 +-- .env.production | 4 +-- src/constants/greetings.json | 35 +++++++++++++++++++ src/router/index.js | 8 +++++ src/stores/api/account.js | 28 +++++++++++++++ src/stores/auth/index.js | 2 ++ src/views/Profile/IntegrationView.vue | 49 ++++++++++++++++++++++++--- 7 files changed, 121 insertions(+), 9 deletions(-) diff --git a/.env.development b/.env.development index dbd63fd..9be48c3 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ VITE_API_URL="http://10.5.7.5:8000/" VITE_API_KEY="your_api_key_should_be_here" VITE_ASSET_PATH="/assets" -VITE_DISCORD_OAUTH_URL="https://discord.com/api/oauth2/authorize?client_id=947985989421395988&redirect_uri=https%3A%2F%2Fphaseii.network%2Faccount%2Fdiscord_callback&response_type=code&scope=identify" -VITE_TACHI_OAUTH_URL="https://kamai.tachi.ac/oauth/request-auth?clientID=CI820ca69046783e9fb4cc7d616f985ea2cab00f5f" \ No newline at end of file +VITE_DISCORD_OAUTH_URL="https://discord.com/oauth2/authorize?client_id=947985989421395988&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A5173%2F%23%2Fprofile%2Fintegrate%2Fdiscord&scope=identify" +VITE_TACHI_OAUTH_URL="https://kamai.tachi.ac/oauth/request-auth?clientID=CIb72d1ff81fcfdc001ead8bde3a0ae1a7e0663a37" \ No newline at end of file diff --git a/.env.production b/.env.production index f1a3f4a..b947174 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,5 @@ VITE_API_URL="https://restfulsleep.phaseii.network" VITE_API_KEY="your_api_key_should_be_here" VITE_ASSET_PATH="https://cdn.phaseii.network/file/PhaseII/web-assets" -VITE_DISCORD_OAUTH_URL="" -VITE_TACHI_OAUTH_URL="" \ No newline at end of file +VITE_DISCORD_OAUTH_URL="https://discord.com/oauth2/authorize?client_id=947985989421395988&response_type=code&redirect_uri=https%3A%2F%2Fweb3.phaseii.network%2F%23%2Fprofile%2Fintegrate%2Fdiscord&scope=identify" +VITE_TACHI_OAUTH_URL="https://kamai.tachi.ac/oauth/request-auth?clientID=CIce4260e1939ceed11c8e48ee857a3aef2a87ba56" \ No newline at end of file diff --git a/src/constants/greetings.json b/src/constants/greetings.json index bb77f56..c09e5b8 100644 --- a/src/constants/greetings.json +++ b/src/constants/greetings.json @@ -383,5 +383,40 @@ "author": "caldenzer", "header": "YO YO YO YO YO WHAT IT IS ", "comment": "hey pac man, what's up?" + }, + { + "author": "calgamer", + "header": "You should probably play Time Crisis instead, ", + "comment": "Time Crisis is pretty good.." + }, + { + "author": "caldoora", + "header": "Did you have a good LovePlus Date, ", + "comment": "I hope you did." + }, + { + "author": "Azui", + "header": "Lock in, !", + "comment": "More seconds you spend picking a song means less time for MFCs!" + }, + { + "author": "Yonokid", + "header": "⠀⠀", + "comment": "⠀⠀⠀⠀⠀How do I center it" + }, + { + "author": "timeripple", + "header": "Up freaking your guitar ?", + "comment": "Or got that mania for drums?" + }, + { + "author": "Anonymous", + "header": "Let’s enjoy music, !", + "comment": "" + }, + { + "author": "timeripple", + "header": "phasing on 's II til they network", + "comment": "networking on my phase til i II?" } ] \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 0bf3e0c..1816177 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -66,6 +66,14 @@ const routes = [ name: "profile_integrations", component: () => import("@/views/Profile/IntegrationView.vue"), }, + { + meta: { + title: "Integration Callback", + }, + path: "/profile/integrate/:service", + name: "profile_integration_callback", + component: () => import("@/views/Profile/IntegrationView.vue"), + }, { meta: { title: "Login Cards", diff --git a/src/stores/api/account.js b/src/stores/api/account.js index 49fc396..b349cb9 100644 --- a/src/stores/api/account.js +++ b/src/stores/api/account.js @@ -113,3 +113,31 @@ export async function APIGetPlayVideos() { throw error; } } + +export async function APIRemoveIntegration(service) { + try { + const confirmed = window.confirm("Are you really?"); + if (confirmed) { + const data = await mainStore.callApi( + `/user/integrate/${service}`, + "DELETE" + ); + return data; + } + } catch (error) { + console.log("Error deleting integration:", error); + throw error; + } +} + +export async function APIIntegrateWith(service, code) { + try { + const data = await mainStore.callApi(`/user/integrate/${service}`, "POST", { + code: code, + }); + return data; + } catch (error) { + console.log(`Error integrating with ${service}:`, error); + throw error; + } +} diff --git a/src/stores/auth/index.js b/src/stores/auth/index.js index 35da0cd..3c6c786 100644 --- a/src/stores/auth/index.js +++ b/src/stores/auth/index.js @@ -14,6 +14,8 @@ export function saveUserAuthKey(sessionId, expires) { try { Cookies.set("userAuthKey", sessionId, { expires: expires, + path: "", + sameSite: "strict", }); } catch (error) { this.errorCode = error.message; diff --git a/src/views/Profile/IntegrationView.vue b/src/views/Profile/IntegrationView.vue index 78cef30..f80ae54 100644 --- a/src/views/Profile/IntegrationView.vue +++ b/src/views/Profile/IntegrationView.vue @@ -1,6 +1,7 @@ @@ -75,7 +114,7 @@ function removeService(service) { v-if="!userData[service.id] || !userData[service.id]?.linked" class="text-lg" > - Discord isn't linked! + {{ service.name }} isn't linked!