Comments (8)
I'm not sure where you're seeing Promise<any>
. In the exported declaration file, I am seeing it as expected. It may be because the interfaces aren't included in the package. If you could tell me how to reproduce it would be very helpful.
from js-pkce.
mkdir js-pkce-test
cd js-pkce-test
npm init
npm i typescript js-pkce
npx tsx --init
import PKCE from 'js-pkce'
const pkce = new PKCE({
client_id: 'myclientid',
redirect_uri: 'http://localhost:8080/auth',
authorization_endpoint: 'https://authserver.com/oauth/authorize',
token_endpoint: 'https://authserver.com/oauth/token',
requested_scopes: '*',
});
pkce.exchangeForAccessToken('dummy',{})
In VSCode small window, that return type was infered as Promise<any>
Strangely, in this reproduction, PHPStorm infers correctly. (My project does not.)
I think it is not js-pkce
problem. Sorry.
from js-pkce.
Ok. I'm going to try to recreate on my own with vscode and see if I can fix it. Thanks.
from js-pkce.
Looks like npm package does not have types:
from js-pkce.
I'll have another look at this. Thanks for the additional detail.
from js-pkce.
How do you guys use this package in the browser? What is your tsconfig?
from js-pkce.
The readme has example of use in browser. You don't need a tsconfig.
from js-pkce.
This issue should be resolved in version 1.2.1
from js-pkce.
Related Issues (17)
- `dist/PKCE.d.ts` is missing HOT 2
- If I set state in using additionalParams object in authorizeUrl method then after checking response with exchangeForAccessToken I get error 'Invalid State' HOT 5
- token revoke HOT 1
- could you please export ITokenResponse interface from PKCE.d.ts ? HOT 3
- getting JSON parse error while running npm audit HOT 1
- not getting email data from requested scopes HOT 1
- Uncaught (in promise) Error: Cannot resolve "crypto" from ... HOT 3
- How can I get CSRF before exchangeForAccessToken? HOT 1
- Support for custom params HOT 5
- id token HOT 4
- Not usable from browser extensions due to usage of Storage API HOT 2
- Add configuration to allow sending credentials HOT 5
- Unique code_challenge per request HOT 3
- PKCE.exchangeForAccessToken and error response HOT 2
- Request for an example HOT 1
- Firefox sessionStorage Issues HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-pkce.