mirror of
				https://github.com/Dan6erbond/sk-auth.git
				synced 2025-10-26 10:22:56 +01: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_REDDIT_API_KEY: string; | ||||
|   VITE_REDDIT_API_SECRET: string; | ||||
|   VITE_SPOTIFY_API_KEY: string; | ||||
|   VITE_SPOTIFY_API_SECRET: string; | ||||
|   VITE_JWT_SECRET_KEY: string; | ||||
| } | ||||
|  | ||||
| @ -5,6 +5,7 @@ import { | ||||
|   GoogleOAuth2Provider, | ||||
|   RedditOAuth2Provider, | ||||
|   TwitterAuthProvider, | ||||
|   SpotifyOAuth2Provider, | ||||
| } from "sk-auth/providers"; | ||||
| 
 | ||||
| export const appAuth = new SvelteKitAuth({ | ||||
| @ -45,6 +46,13 @@ export const appAuth = new SvelteKitAuth({ | ||||
|         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: { | ||||
|     jwt(token, profile) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user