diff --git a/app/package.json b/app/package.json index 4659d25..1b77a56 100644 --- a/app/package.json +++ b/app/package.json @@ -33,6 +33,7 @@ "dependencies": { "@fontsource/fira-mono": "^4.3.0", "@fontsource/inter": "^4.3.0", + "clipboard": "^2.0.8", "clsx": "^1.1.1", "prismjs": "^1.23.0", "sk-auth": "file:../" diff --git a/app/src/global.d.ts b/app/src/global.d.ts index 36173c0..6381d5e 100644 --- a/app/src/global.d.ts +++ b/app/src/global.d.ts @@ -11,7 +11,7 @@ interface ImportMetaEnv { VITE_TWITTER_API_SECRET: string; VITE_REDDIT_API_KEY: string; VITE_REDDIT_API_SECRET: string; - VITE_SPOTIFY_API_KEY: string; - VITE_SPOTIFY_API_SECRET: string; + VITE_SPOTIFY_CLIENT_ID: string; + VITE_SPOTIFY_CLIENT_SECRET: string; VITE_JWT_SECRET_KEY: string; } diff --git a/app/src/lib/appAuth.ts b/app/src/lib/appAuth.ts index d9397b9..74d1664 100644 --- a/app/src/lib/appAuth.ts +++ b/app/src/lib/appAuth.ts @@ -47,8 +47,8 @@ export const appAuth = new SvelteKitAuth({ }, }), new SpotifyOAuth2Provider({ - apiKey: import.meta.env.VITE_SPOTIFY_API_KEY, - apiSecret: import.meta.env.VITE_SPOTIFY_API_SECRET, + clientId: import.meta.env.VITE_SPOTIFY_CLIENT_ID, + clientSecret: import.meta.env.VITE_SPOTIFY_CLIENT_SECRET, profile(profile) { return { ...profile, provider: "spotify" }; }, diff --git a/app/src/routes/login.svelte b/app/src/routes/login.svelte index df5cf77..0e34452 100644 --- a/app/src/routes/login.svelte +++ b/app/src/routes/login.svelte @@ -180,6 +180,62 @@ Sign in with Reddit + + + + Sign in with Spotify + +
Coming soon.
diff --git a/app/src/routes/profile.svelte b/app/src/routes/profile.svelte index 9b61cbc..44fa861 100644 --- a/app/src/routes/profile.svelte +++ b/app/src/routes/profile.svelte @@ -201,6 +201,47 @@ {/if} +Signed in as:
+ + {$session.user.connections.spotify.display_name} + {:else} +Not signed in
+Session
diff --git a/app/yarn.lock b/app/yarn.lock index dfa041d..a942399 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -1467,7 +1467,7 @@ chokidar@^3.5.1: optionalDependencies: fsevents "~2.3.1" -clipboard@^2.0.0: +clipboard@^2.0.0, clipboard@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.8.tgz#ffc6c103dd2967a83005f3f61976aa4655a4cdba" integrity sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ== @@ -3441,12 +3441,6 @@ simple-swizzle@^0.2.2: cookie "^0.4.1" jsonwebtoken "^8.5.1" -"sk-auth@file:../": - version "0.3.7" - dependencies: - cookie "^0.4.1" - jsonwebtoken "^8.5.1" - slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" diff --git a/src/providers/spotify.ts b/src/providers/spotify.ts index 972e3a9..bc94359 100644 --- a/src/providers/spotify.ts +++ b/src/providers/spotify.ts @@ -43,6 +43,7 @@ const defaultConfig: Partial