Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug into redis example #66

Open
antoniosap opened this issue Mar 6, 2018 · 5 comments
Open

bug into redis example #66

antoniosap opened this issue Mar 6, 2018 · 5 comments

Comments

@antoniosap
Copy link

TypeError: expecting a function but got [object Object]
on
var db = require('bluebird').promisify(require('redis').createClient());

@cryptiklemur
Copy link

Redis example is also missing saveAuthorizationCode, and using the wrong package oauth2-server vs express-oauth-server, and not initializing the class.

@antoniosap
Copy link
Author

and then ? trash everything ?

@tobilg
Copy link

tobilg commented Apr 2, 2018

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.

@moacode
Copy link

moacode commented Aug 14, 2018

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.

@Rayan20
Copy link

Rayan20 commented Jun 1, 2020

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`');
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants