Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Add support for private apps #99

Merged
merged 1 commit into from
Feb 9, 2021
Merged

Add support for private apps #99

merged 1 commit into from
Feb 9, 2021

Conversation

paulomarg
Copy link
Contributor

WHY are these changes introduced?

Currently, both the GraphQL and REST clients require an access token when created, which works for public / custom apps, but not for private ones since they don't go through OAuth. This PR aims to solve that problem by adding a setting to the library to indicate that the current app is a private one.

WHAT is this pull request doing?

If the app is private, the clients will automatically switch over to using the app's password as the access token, rather than the one obtained in the constructor. That way, callers just need to know the shop for which they're making requests and the library handles the logic of which value to send as the access token header.

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

@paulomarg paulomarg requested a review from a team as a code owner February 9, 2021 18:09
src/auth/oauth/oauth.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@thecodepixi thecodepixi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@paulomarg paulomarg merged commit 2d25cf9 into main Feb 9, 2021
@paulomarg paulomarg deleted the add_private_app_support branch February 9, 2021 20:43
@thecodepixi thecodepixi temporarily deployed to production February 10, 2021 16:52 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants