0
私はtrelloアカウントでの認証にpassport-trelloを使っています。エラー:セッション中のリクエストトークンを見つけることができませんでした。パスポートjs
Error: Failed to find request token in session
このエラーは、既にtrelloプロンプトにリダイレクトされているときと、[許可]ボタンをクリックした直後に発生します。
ルーティング:
app.get('/auth/trello', passport.authenticate('trello'));
app.get('/auth/trello/callback', passport.authenticate('trello', {
successRedirect: '/',
failureRedirect: '/error/'
}));
TrelloStrategy:この問題を解決する方法を知っている
export default() => {
passport.use(new TrelloStrategy({
consumerKey: process.env.TRELLO_CONSUMER_KEY,
consumerSecret: process.env.TRELLO_CONSUMER_SECRET,
callbackURL: 'http://localhost:3000/auth/trello/callback',
trelloParams: {
scope: 'read',
name: 'CommonFeed',
expiration: 'never'
}
}, (req, token, tokenSecret, profile, done) => {
let user = {};
user.token = token;
user.profile = profile;
done(null, user);
}));
}
?ありがとう、事前に
'token'と' profile'引数に値がありますか? –
いくつかの魔法の問題は解決されています、どのように、何かを伝えることはできません。しかし、 'tokenSecret'は空のオブジェクトを返します。そしてそれでも、trelloの認証はうまくいった。それは何であるはずですか?ドキュメントによると – mcmxc
は秘密のトークンをまったく持っていないようです。普通のものです。 –