oauth-jsclient icon indicating copy to clipboard operation
oauth-jsclient copied to clipboard

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

Open abisalehalliprasan opened this issue 4 years ago • 4 comments

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.

abisalehalliprasan avatar Oct 13 '20 23:10 abisalehalliprasan

@abisalehalliprasan I am picking this up now.

nsinghal12 avatar Oct 15 '20 00:10 nsinghal12

@nsinghal12 : Awesome. Thanks 🚀

abisalehalliprasan avatar Oct 16 '20 05:10 abisalehalliprasan

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

nikhilbhatia08 avatar Sep 21 '23 13:09 nikhilbhatia08

any updates? is the issue open?

rum1887 avatar Oct 02 '23 06:10 rum1887