Skip to content

Commit

Permalink
@uppy/companion: rename getExtraConfig to getExtraGrantConfig (#5198
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mifi authored and aduh95 committed May 30, 2024
1 parent ba83c76 commit b052d21
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/guides/migration-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ These cover all the major Uppy versions and how to migrate to them.
- The URL endpoint (used by the `Url`/`Link` plugin) is now turned off by
default and must be explicitly enabled with
`COMPANION_ENABLE_URL_ENDPOINT=true` or `enableUrlEndpoint: true`.
- Custom provider breaking changes. If you have not implemented a custom
provider, you should not be affected.
- The static `getExtraConfig` property has been renamed to
`getExtraGrantConfig`.

## Migrate from Robodog to Uppy plugins

Expand Down
3 changes: 1 addition & 2 deletions packages/@uppy/companion/src/server/provider/Provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ class Provider {

/**
* config to extend the grant config
* todo major: rename to getExtraGrantConfig
*/
static getExtraConfig () {
static getExtraGrantConfig () {
return {}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion/src/server/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ module.exports.addProviderOptions = (companionOptions, grantConfig, getAuthProvi
}

const provider = exports.getDefaultProviders()[providerName]
Object.assign(grantConfig[authProvider], provider.getExtraConfig())
Object.assign(grantConfig[authProvider], provider.getExtraGrantConfig())

// override grant.js redirect uri with companion's custom redirect url
const isExternal = !!server.implicitPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function getMediaUrl ({ token, id }) {
*/
class Instagram extends Provider {
// for "grant"
static getExtraConfig () {
static getExtraGrantConfig () {
return {
protocol: 'https',
scope: ['user_profile', 'user_media'],
Expand Down

0 comments on commit b052d21

Please sign in to comment.