Skip to content
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

[typescript][issue]: Passing custom state parameter within typings definition file #103

Open
abisalehalliprasan opened this issue Oct 13, 2020 · 4 comments
Labels
enhancement New feature or request hacktoberfest

Comments

@abisalehalliprasan
Copy link
Collaborator

Hacktoberfest is underway right now and we would love for you to contribute 🚀 . More information on #hacktoberfest is here

Develop-with-Intuit for Hacktoberfest

Problem

SDK should support passing the state parameter. Provide a fix to support this in the typings definitions: index.d.ts file

node_modules/intuit-oauth/index.d.ts:112:9
    112         state?: csrf;
                ~~~~~

The expected type comes from property 'state' which is declared here on type AuthorizeParams
const authUri = oauthClient.authorizeUri({scope:[OAuthClient.scopes.Accounting,OAuthClient.scopes.OpenId],state:'testState'});

Errors dissapears if you let SDK provide a csrf using the moule :

const authUri = oauthClient.authorizeUri({scope:[OAuthClient.scopes.Accounting,OAuthClient.scopes.OpenId]});

Fix Needed

The SDK typings definition file should allow custom state parameters ( string ) to be passed.

Instructions to use the sample app

In order to test the typings locally from the sample project, you'll need to link the intuit-oauth package with yarn or npm.

# Link local intuit-oauth branch with typings support to sample typescript project
yarn link
cd sample/typescript
yarn link intuit-oauth

PR Guidelines

Kindly follow the below instructions to submit your PR :

  • Fork and clone the repository (typescript branch).
  • Run npm install for dependencies.
  • Test all your changes.
  • Run npm test to execute all specs.

Once ready, please submit a PR to the typescript branch here.
Note : PR's will be merged to the master branch once all the testing is completed.

@nsinghal12
Copy link

@abisalehalliprasan I am picking this up now.

@abisalehalliprasan
Copy link
Collaborator Author

@nsinghal12 : Awesome. Thanks 🚀

@nikhilbhatia08
Copy link

nikhilbhatia08 commented Sep 21, 2023

@abisalehalliprasan I am a beginner can you guide me to fix this issue and can I work on this issue?

@rum1887
Copy link

rum1887 commented Oct 2, 2023

any updates? is the issue open?

edgarsherman pushed a commit to edgarsherman/oauth-jsclient that referenced this issue Oct 2, 2023
- update AuthorizeParams typings.  The state should allow for any arbitrary string.  fixes intuit#103
@rajeshgupta723 rajeshgupta723 added the enhancement New feature or request label Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

5 participants