-
Notifications
You must be signed in to change notification settings - Fork 112
Add getOAuthApi method #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e of a fetch call
🦋 Changeset detectedLatest commit: 97b1e1e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@mattzcarey - Can you give this a review? @kentonv - Found a neat way to add methods to the provider without exposing them over RPC |
|
@kentonv Updated with requested changes. |
commit: |
This PR makes OAuthHelpers available outside of the
fetchmethod (i.e. in a worker's RPC methods) via thegetOAuthApifunction.Problem
this.env.OAUTH_PROVIDERgets populated inOAuthProviderImpl.fetch(), so if we try to use it in a worker's RPC methods, for example, it will always be undefined.Solution
We add a method
getOAuthApi(options: OAuthProviderOptions, env: any)that initializes and retrieves OAuthHelpers directly.