@vatsim/passport-vatsim
v1.0.0
Published
express middleware for passportjs & vatsim
Downloads
2
Readme
passport-vatsim
oauth2 middleware for vatsim connect using passport.js and express
example usage in example
installation:
npm install passport-vatsim
import vatsim from "passport-vatsim";
const config = { clientID, clientSecret, callbackURL, scope };
const handler = (accessToken, refreshToken, profile, callback) => {
const user = db.findOrCreate({ id: profile.cid });
return callback(null, user);
}
passport.use(vatsim(config, handler));
app.get("/", passport.authenticate("vatsim"), (req, res) => ...)
Typescript
You can also import the user profile type
import vatsim, { Profile } from "passport-vatsim";