@vatsim/passport-vatsim

express middleware for passportjs & vatsim

Usage no npm install needed!

<script type="module">
  import vatsimPassportVatsim from 'https://cdn.skypack.dev/@vatsim/passport-vatsim';
</script>

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";