Fast solution for webview requests authorization
const { Processor } = require('wingbot');
const { BotTokenStorage } = require('wingbot-jwt');
const processor = new Processor(bot, {
tokenStorage: new BotTokenStorage('<put a secret here>', { expiresIn: '30d' })
})- BotTokenStorage
Storage for JWT tokens
- Token :
Object
Storage for JWT tokens
Kind: global class
- BotTokenStorage
- new BotTokenStorage(secretOrPrivateKey, [jwtOptions])
- .findByToken(token) ⇒
Promise.<(Token|null)> - .getOrCreateToken(senderId, pageId) ⇒
Promise.<(Token|null)>
| Param | Type |
|---|---|
| secretOrPrivateKey | string | Buffer |
| [jwtOptions] | Object |
Kind: instance method of BotTokenStorage
| Param | Type |
|---|---|
| token | string |
Kind: instance method of BotTokenStorage
| Param | Type |
|---|---|
| senderId | string |
| pageId | string |
Kind: global typedef
Properties
| Name | Type |
|---|---|
| senderId | string |
| pageId | string |
| token | string |