mikenicholson/passport-jwt

What is the reason for not renaming Strategy to JWTStrategy in this module but in the import instead?

StefanLobbenmeier opened this issue · 2 comments

I am very new to node.js and typescript. To me, finding out that you need to write

import {Strategy as JWTStrategy, ExtractJwt} from "passport-jwt";

to use the JWTStrategy was a lot of effort. Looking back at the tutorial I used and the readme I now realise this was also done similarly in JavaScript - but I guess it would be nice to include this also in this readme on how to do it in TypeScript?

Not sure about the correct way to make it easier for newbies like me and maybe I am just alone in this situation but I wanted to raise it as an issue anyway.

surdu commented

I don't think you have to rename it to JWTStrategy, you might just well use it as Strategy

You can alias it to "bob' for all it matters, aliasing it to JWTStrategy is just done for clarity.