Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @ladjs/passport with all npm packages installed. Try it out:

var passport = require("@ladjs/passport")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@ladjs/passport v2.0.2

Passport for Lad

passport

build status code coverage code style styled with prettier made with lass license

Passport for Lad

Table of Contents

Install

npm:

npm install @ladjs/passport

yarn:

yarn add @ladjs/passport

Usage

const Passport = require('@ladjs/passport');
const koa = require('koa');
const mongoose = require('mongoose');
const passportLocalMongoose = require('passport-local-mongoose');

const User = new mongoose.Schema();
User.plugin(passportLocalMongoose, {
  // ...
});
const Users = mongoose.model('User', UserSchema);

const passport = new Passport(Users, {
  // ...
});

const app = new Koa();
app.use(passport.initialize());
app.use(passport.session());

Options

See index.js for configuration defaults and environment flags.

You can customize the field names, see the fields object in index.js.

Contributors

NameWebsite
Nick Baughhttp://niftylettuce.com/
Shaun Warmanhttps://shaunwarman.com/
shadowgate15https://github.com/shadowgate15

License

MIT © Nick Baugh

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free