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
passport typescript type conflict #47
Comments
@wyattjoh - Thanks for the report here! We're taking a look internally and post back when we have a path forward 👍 |
@wyattjoh - I wanted to check back in with you here ... it looks like the main culprit here is a change made to the Passport definitions earlier this year (commit). That switched it from Can you provide some simple repro steps to generate this error? If your project is open source and has install instructions, that would be fine. Otherwise, just a way that I can generate that error, then test with the fix in place. Thank you! |
Sure @joshcanhelp! You can grab the following repo/branch: coralproject/talk#1743 git clone https://github.com/coralproject/talk.git
cd talk
git checkout next-passport
npm install
npm run compile:graphql
npm run build:server That currently, will throw the following error:
|
Thanks for that, works as expected ... AFAIK :) And just so I'm sure, I'm expecting no errors and a // node_modules/@types/passport/index.d.ts:15
declare global {
namespace Express {
interface Request {
authInfo?: any;
user?: User | any; // still use the `User` interface but allow `any` as well
// ...
}
}
} If you can just confirm what I'm getting or make that change and try it out, I'll put through a PR for that. |
That looks like it works perfectly @joshcanhelp! Would love a PR submitted to resolve it 😄 |
PR submitted: DefinitelyTyped/DefinitelyTyped#27339 |
* Fix up Request.authInfo/user declarations in Passport * Add myself * Use no-empty-interface locally
Trying to use this package along with a custom passport strategy with express.
Issue is that this package includes the definitions from express-jwt, which are causing issues with projects that include both passport and node-jwks-rsa.
DefinitelyTyped/DefinitelyTyped#23976
Any recommendations to resolve this conflict of the
Request.user
type?The text was updated successfully, but these errors were encountered: