# wejsv2old-passport

> Passport logic and config for We.js v2

Latest version **0.1.2** (published 2015-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install wejsv2old-passport
pnpm add wejsv2old-passport
yarn add wejsv2old-passport
bun add wejsv2old-passport
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2015-10-28 |
| First published | 2015-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Alberto Souza |
| Maintainers | albertosouza |

## Links

- npm: https://www.npmjs.com/package/wejsv2old-passport
- Repository: https://github.com/wejsv2old/wejsv2old-passport
- Homepage: https://github.com/wejsv2old/wejsv2old-passport#readme
- Issues: https://github.com/wejsv2old/wejsv2old-passport/issues
- npm.io page: https://npm.io/package/wejsv2old-passport

## Dependencies (2)

- [passport](https://npm.io/package/passport.md) ~0.2.0
- [passport-local](https://npm.io/package/passport-local.md) ~1.0.0

## Recent versions

- 0.1.2 (latest) — 2015-10-28

## README

# we-passport

Passport logic and configurator for We.js

## Installation

Install it on you sails project

```sh
npm install we-passport --save
```

And create one custom Policy ex: PassportPolicy with:

```js
//file api/policies/PassportPolicy.js
var wePassport = require('we-passport');
// initialize passport configs
var passportMiddleware =  wePassport.init();

/**
 * Use this Passport policy to check user acesss and pepopulate current logged in user
 */
module.exports = function (req, res, ok) {
  passportMiddleware(req, res, ok);
};

```

And finely add to you policies.js configs:

```js
//file configs/policies.js
module.exports.policies = {

  '*':['PassportPolicy'],
  'messenger': [
    'PassportPolicy',
    'AllRoutesPolicy',
    'MessengerPolicy'
  ],
  //'main': 'MainPolicy',
  'activity': [
    'PassportPolicy',
    'AllRoutesPolicy'
  ]

  // ...
};

```
@TODO check how to make this configs easy ...

## Usage

In controller
```js
var passport = require('we-passport').getPassport();

```

## Configuration

TODO!

## Credits
[Alberto Souza](https://github.com/albertosouza/) -
License: MIT

---
_Source: https://npm.io/package/wejsv2old-passport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
