# passport-qgame

> Passport strategy for vivo qgame.

Latest version **1.0.0** (published 2019-02-21) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-02-21 |
| First published | 2019-02-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.4.0 |
| Dependencies | 5 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ling Ye |
| Maintainers | lingye |
| Keywords | passport, strategy, vivo, qgame |

## Links

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

## Dependencies (5)

- [md5](https://npm.io/package/md5.md) ^2.2.1
- [axios](https://npm.io/package/axios.md) ^0.18.0
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [querystring](https://npm.io/package/querystring.md) ^0.2.0
- [passport-strategy](https://npm.io/package/passport-strategy.md) ^1.0.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-02-21

## README

# passport-qgame

vivo 小游戏帐号接入
授权拿到code后，获取 access_token 并返回用户信息

```json
{
  "provider": "qgame",
  "expires_in": 86400,
  "refresh_token": "...",
  "access_token": "...",
  "nickname": "...",
  "openid": "...",
  "avatar": "..."
}
```

```js
// express 使用示例

const passport = require('passport');
const QgameStrategy = require('passport-qgame');

passport.use(new QgameStrategy({
  key, screct, passReqToCallback: true
}, function(req, profile, done){
  // 处理 profile, 查找或创建用户
  const user = User.findOrCreate();

  // 完成
  done(null, user);
}));

// router
app.get("/auth/qgame", passport.authenticate('qgame', {
  session: false,
  successReturnToOrRedirect: null,
}), function() {});

```


## License

[MIT](LICENSE)

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