bnoguchi/mongoose-auth

rememberTokenSecret of 'twitter' is promising: requestTokenSecret: however, the step returns nothing

rohitcolinrao opened this issue · 7 comments

I'm getting the following error when I try and run a twitter auth:

Error: Step rememberTokenSecret of twitter is promising: requestTokenSecret ; however, the step returns nothing. Fix the step by returning the expected values OR by returning a Promise that promises said values.

... not sure what's up. here is my code, any thoughts?

var express = require('express')
, routes = require('./routes')
, util = require('util')
, io = require('socket.io')
, users = require('./lib/users')
, mongoose = require('mongoose')
, Schema = mongoose.Schema
, ObjectId = mongoose.SchemaTypes.ObjectId
, conf = require('./lib/oauth_providers')
, mongooseAuth = require('mongoose-auth');

//db
mongoose.connect("mongodb://user:pass@mongourl.com:10030");

//db user schema
var UserSchema = new Schema({})
, User;
//db users setup
UserSchema.plugin(mongooseAuth, {
everymodule: {
everyauth: {
User: function() {
return User;
}
}
},
facebook: {
everyauth: {
myHostname: 'http://dev.xyz.com:3000',
appId: conf.fb.appId,
appSecret: conf.fb.appSecret,
redirectPath: '/test1'
}
},
twitter: {
everyauth: {
myHostname: 'http://dev.xyz.com:3000',
consumerKey: conf.twit.consumerKey,
consumerSecret: conf.twit.consumerSecret,
redirectPath: '/test1'
}
}
});
mongoose.model('User', UserSchema);

User = mongoose.model('User');

var app = module.exports = express.createServer();

// App Configuration
app.configure(function(){
app.set('views', dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({secret: "90ndsj9dfdsf"}));
app.use(mongooseAuth.middleware());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(dirname + '/public'));
});

mongooseAuth.helpExpress(app);

app.configure('development', function(){
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});

app.configure('production', function(){
app.use(express.errorHandler());
});

// Routes
app.get('/test1', routes.index);

app.listen(3000);
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);

Nvrmind, found the issue. I still had app.router in my middleware chain. Removing it did the trick.

Getting this same error, works via localhost but not on production server. I have removed the app router as well. HELP!

I need help as well - this crops up all the time. On my iPhone it happens every single time I try to authenticate with Twitter. In the browser and iPad, I randomly get this sometimes, but usually I authenticate to Twitter with no problem:

starting step - getRequestToken
...finished step
starting step - storeRequestToken
...finished step
starting step - redirectToProviderAuth
...finished step
starting step - extractTokenAndVerifier
...finished step
starting step - getSession
...finished step
starting step - rememberTokenSecret

/var/www/lab/memecube/node_modules/connect-redis/node_modules/redis/index.js:487
throw err;
^
Error: Step rememberTokenSecret of twitter is promising: requestTokenSecret ; however, the step returns nothing. Fix the step by returning the expected values OR by returning a Promise that promises said values.
at Object.exec (/var/www/lab/memecube/node_modules/everyauth/lib/step.js:68:11)
at /var/www/lab/memecube/node_modules/everyauth/lib/stepSequence.js:26:38
at [object Object].fulfill (/var/www/lab/memecube/node_modules/everyauth/lib/promise.js:42:25)
at /var/www/lab/memecube/node_modules/everyauth/lib/stepSequence.js:29:23
at [object Object].callback (/var/www/lab/memecube/node_modules/everyauth/lib/promise.js:13:12)
at /var/www/lab/memecube/node_modules/everyauth/lib/stepSequence.js:28:23
at [object Object].fulfill (/var/www/lab/memecube/node_modules/everyauth/lib/promise.js:42:25)
at /var/www/lab/memecube/node_modules/everyauth/lib/modules/oauth.js:154:15
at /var/www/lab/memecube/node_modules/connect-redis/lib/connect-redis.js:119:18
at try_callback (/var/www/lab/memecube/node_modules/connect-redis/node_modules/redis/index.js:484:9)

This happens when I run the example server in mongoose-auth "0.0.12". Looks pretty broken when the official example does not work...:-(

Similar to issue #164, has anyone solved this?

I solved this issue by merging daeq's c5a36bd7 and alexahn's fdd06f. They're merged into my fork at https://github.com/newleafdigital/everyauth/commits/express3 (note the express3 branch). I'll make a pull request for these commits shortly.

Pull request at bnoguchi/everyauth#358. Please request it be escalated in priority if this affects you too.