apollo-passport-mongodb
Forked from tomitrescak/apollo-passport-mongodb
MongoDB native driver for apollo-passport
Copyright (c) 2016 by Gilad Shoham, released under the MIT license.
New Features in this fork (Highlights)
- Add verifyUserAccount function
- Add function to add reset password tokens
- Add update user function
- Follow emails standard from here: passportjs-profile
Usage
import { MongoClient } from 'mongodb';
import MongoDriver from 'apollo-passport-mongodb-driver';
const m = await MongoClient.connect(`mongodb://${host}:${port}/${name}`);
const apolloPassport = new ApolloPassport({
db: new MongoDriver(m)
});
Optional parameters, e.g. if your users
table is called something else:
new MongoDriver(r, {
userTableName: 'users',
configTableName: 'apolloPassportConfig',
db: '(override default database given to mongo)'
});
See apollo-passport and apollo-passport-local-strategy for more info.
Create your own DBDriver
This package is fully documented with 100% test coverage. It can be used as a basis for creating other DBDrivers for Apollo Passport.
See also the API Docs, ordered by version and viewable online via rawgit, e.g. v0.0.2 API Docs on RawGit.