From 61265e712a5f8b6b23d79d9790b7528273144dd8 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 06:30:54 +0000 Subject: [PATCH 1/3] auto: format code --- packages/openauth/src/adapter/index.ts | 1 + packages/openauth/src/adapter/spotify.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 packages/openauth/src/adapter/spotify.ts diff --git a/packages/openauth/src/adapter/index.ts b/packages/openauth/src/adapter/index.ts index 48675f1..6c7bce4 100644 --- a/packages/openauth/src/adapter/index.ts +++ b/packages/openauth/src/adapter/index.ts @@ -1,2 +1,3 @@ export * from "./code.js" export type { Adapter } from "./adapter.js" +export * from "./spotify.js" diff --git a/packages/openauth/src/adapter/spotify.ts b/packages/openauth/src/adapter/spotify.ts new file mode 100644 index 0000000..606dd2d --- /dev/null +++ b/packages/openauth/src/adapter/spotify.ts @@ -0,0 +1,18 @@ +import { Oauth2Adapter, type Oauth2WrappedConfig } from "./oauth2.js" + +export function SpotifyAdapter(config: Oauth2WrappedConfig) { + return Oauth2Adapter({ + ...config, + type: "spotify", + endpoint: { + authorization: "https://accounts.spotify.com/authorize", + token: "https://accounts.spotify.com/api/token", + }, + scopes: [ + "user-read-private", + "user-read-email", + "playlist-read-private", + "user-library-read", + ], + }) +} From 392d66cf7423905af1b45aeb923bbf50c3f5d3a1 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 06:41:20 +0000 Subject: [PATCH 2/3] Remove predefined scopes from Spotify adapter to allow user-defined scopes --- .changeset/modern-turtles-marry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/modern-turtles-marry.md diff --git a/.changeset/modern-turtles-marry.md b/.changeset/modern-turtles-marry.md new file mode 100644 index 0000000..c0c8998 --- /dev/null +++ b/.changeset/modern-turtles-marry.md @@ -0,0 +1,5 @@ +--- +"@openauthjs/openauth": patch +--- + +Remove predefined scopes from Spotify adapter to allow user-defined scopes From c1614b8829da890ffecc0049d58d20bc32c001dc Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 06:41:34 +0000 Subject: [PATCH 3/3] auto: format code --- bun.lockb | Bin 237624 -> 237624 bytes packages/openauth/src/adapter/spotify.ts | 6 ------ 2 files changed, 6 deletions(-) diff --git a/bun.lockb b/bun.lockb index 1a5f271c2e1c39583bfe5d9e35120d957f9a7bbd..5046fbaf7ce78b71f2cbd1ace8e9a0762503eff2 100755 GIT binary patch delta 54 zcmdmSfN#eEzJ?aYElg9hIhYtApnYyO)AqU9%+HM`KTzeE+@PT_c>|FCqNTI_!93;& FMgad46Bhsg delta 48 zcmdmSfN#eEzJ?aYElg9hIT(%fjLh{64cg~sGi{%n&HUVGdd^Qq0}!FJ{lPru2u1+F Cni6~f diff --git a/packages/openauth/src/adapter/spotify.ts b/packages/openauth/src/adapter/spotify.ts index 606dd2d..e152376 100644 --- a/packages/openauth/src/adapter/spotify.ts +++ b/packages/openauth/src/adapter/spotify.ts @@ -8,11 +8,5 @@ export function SpotifyAdapter(config: Oauth2WrappedConfig) { authorization: "https://accounts.spotify.com/authorize", token: "https://accounts.spotify.com/api/token", }, - scopes: [ - "user-read-private", - "user-read-email", - "playlist-read-private", - "user-library-read", - ], }) }