mikenicholson / passport-jwt

Passport authentication using JSON Web Tokens
MIT License
1.97k stars 215 forks source link

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

Closed StefanLobbenmeier closed 4 years ago

StefanLobbenmeier commented 4 years ago

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 4 years ago

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

mikenicholson commented 4 years ago

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