@ladjs/passport
Version:
Passport for Lad
88 lines (55 loc) • 2.02 kB
Markdown
# @ladjs/passport
[](https://github.com/ladjs/passport/actions/workflows/ci.yml)
[](https://github.com/sindresorhus/xo)
[](https://github.com/prettier/prettier)
[](https://lass.js.org)
[](LICENSE)
> Passport for Lad
## Table of Contents
* [Install](#install)
* [Usage](#usage)
* [Strategies](#strategies)
* [Options](#options)
* [Contributors](#contributors)
* [License](#license)
## Install
[npm][]:
```sh
npm install @ladjs/passport
```
## Usage
```js
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());
```
## Strategies
Currently supported strategies:
* Local (email)
* Apple (Sign in with Apple)
* GitHub
* Google
* OTP
## Options
See [index.js](index.js) for configuration defaults and environment flags.
You can customize the field names and phrases, see the `fields` and `phrases` objects in [index.js](index.js).
## Contributors
| Name | Website |
| ---------------- | --------------------------------- |
| **Nick Baugh** | <http://niftylettuce.com/> |
| **Shaun Warman** | <https://shaunwarman.com/> |
| **shadowgate15** | <https://github.com/shadowgate15> |
## License
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)
##
[npm]: https://www.npmjs.com/