Open antoniosap opened 6 years ago
Redis example is also missing saveAuthorizationCode
, and using the wrong package oauth2-server
vs express-oauth-server
, and not initializing the class.
and then ? trash everything ?
Try using
const redis = require("redis");
const bluebird = require("bluebird");
bluebird.promisifyAll(redis.RedisClient.prototype);
const db = redis.createClient();
instead. I had the same error, and this fixed it.
I had a lot of issues with the Redis example. I've now implemented a fully working example of Redis, and am planning on issuing a pull request to update the example this week.
Have you update the redis example? I still got missing client grants
because this block of code:
The client in the .then(function(client) is a boolean "true", so of course client.grants is undefined.
return promisify(this.model.getClient, 2).call(this.model, credentials.clientId, credentials.clientSecret)
.then(function(client) {
if (!client) {
throw new InvalidClientError('Invalid client: client is invalid');
}
if (!client.grants) {
throw new ServerError('Server error: missing client `grants`');
}
TypeError: expecting a function but got [object Object] on
var db = require('bluebird').promisify(require('redis').createClient());