mirror of
https://github.com/Dan6erbond/sk-auth.git
synced 2025-06-26 01:18:17 +02:00
feat: add spotify oauth2 provider
This commit is contained in:
parent
23293cfbcf
commit
f3ffe44957
2
app/src/global.d.ts
vendored
2
app/src/global.d.ts
vendored
@ -11,5 +11,7 @@ interface ImportMetaEnv {
|
|||||||
VITE_TWITTER_API_SECRET: string;
|
VITE_TWITTER_API_SECRET: string;
|
||||||
VITE_REDDIT_API_KEY: string;
|
VITE_REDDIT_API_KEY: string;
|
||||||
VITE_REDDIT_API_SECRET: string;
|
VITE_REDDIT_API_SECRET: string;
|
||||||
|
VITE_SPOTIFY_API_KEY: string;
|
||||||
|
VITE_SPOTIFY_API_SECRET: string;
|
||||||
VITE_JWT_SECRET_KEY: string;
|
VITE_JWT_SECRET_KEY: string;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import {
|
|||||||
GoogleOAuth2Provider,
|
GoogleOAuth2Provider,
|
||||||
RedditOAuth2Provider,
|
RedditOAuth2Provider,
|
||||||
TwitterAuthProvider,
|
TwitterAuthProvider,
|
||||||
|
SpotifyOAuth2Provider,
|
||||||
} from "sk-auth/providers";
|
} from "sk-auth/providers";
|
||||||
|
|
||||||
export const appAuth = new SvelteKitAuth({
|
export const appAuth = new SvelteKitAuth({
|
||||||
@ -45,6 +46,13 @@ export const appAuth = new SvelteKitAuth({
|
|||||||
return { ...slim, provider: "reddit" };
|
return { ...slim, provider: "reddit" };
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
new SpotifyOAuth2Provider({
|
||||||
|
apiKey: import.meta.env.VITE_SPOTIFY_API_KEY,
|
||||||
|
apiSecret: import.meta.env.VITE_SPOTIFY_API_SECRET,
|
||||||
|
profile(profile) {
|
||||||
|
return { ...profile, provider: "spotify" };
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
callbacks: {
|
callbacks: {
|
||||||
jwt(token, profile) {
|
jwt(token, profile) {
|
||||||
|
Loading…
Reference in New Issue
Block a user