mpauthx
Advanced tools
Comparing version 1.1.7 to 1.1.8
{ | ||
"name": "mpauthx", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Token giver for Users logged in to WeChat Mini-program. Based on top of redis for fast token checking/access, and sqlite3 for flexible user db storage.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,2 +16,4 @@ # mpauthx | ||
```javascript | ||
let sqlite3DBInstance = ...; // create sqlite3 db instance here | ||
const mpauthx = require('mpauthx')( | ||
@@ -28,3 +30,3 @@ '<your app-id here>', // app-id | ||
Call `mpauthx.authorize(code, encryptedData, iv);` whenever your end-point needs to authorize WeChat user logged in from mini-program; treat that `code`, `encryptedData`, and `iv` are information you need to supply. You can get them from [wx.getUserInfo](https://mp.weixin.qq.com/debug/wxadoc/dev/api/open.html#wxgetuserinfoobject). | ||
Call `mpauthx.authorize(code, encryptedData, iv);` whenever your end-point needs to authorize WeChat user and give user a token so user can save such token for subsequent API calls later in the future. | ||
@@ -55,3 +57,3 @@ as well | ||
Primarily focus on `openId` as a requirement to have. | ||
**Primarily** focus on `openId` as a requirement to have. | ||
@@ -71,7 +73,7 @@ # API | ||
```json | ||
```javascript | ||
{ | ||
status_code: <number>, // see core/constants.js or mpauthx.constants for all statuses | ||
status_message: <string>, | ||
response: <object> | ||
response: <string> // returned generated token for such user | ||
} | ||
@@ -78,0 +80,0 @@ ``` |
96
37389