我已经设置了Kubernetes群集。我尝试从this URL安装UI但是当我尝试从浏览器访问用户界面时,我得到以下错误:
const keystone = require('keystone');
const passport = require('passport');
const passportTwitterStrategy = require('passport-twitter').Strategy;
const User = keystone.list('User');
const credentials = {
consumerKey: process.env.TWITTER_CONSUMER_KEY,
consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
callbackURL: process.env.TWITTER_CALLBACK_URL,
includeEmail: true
};
exports.authenticateUser = function(req, res, next) {
const redirect = '/auth/confirm';
const twitterStrategy = new passportTwitterStrategy(credentials, function(accessToken, refreshToken, profile, done) {
done(null, {
accessToken: accessToken,
refreshToken: refreshToken,
profile: profile
});
});
// Pass through authentication to passport
passport.use(twitterStrategy);
// Save user data once returning from Twitter
if (req.query.hasOwnProperty('cb')) {
passport.authenticate('twitter', { session: false }, function(err, data, info) {
if (err || !data) {
return res.redirect('/signin');
}
const name = data.profile && data.profile.displayName ? data.profile.displayName.split(' ') : [];
req.session.auth = {
type: 'twitter',
name: {
first: name.length ? name[0] : '',
last: name.length > 1 ? name[1] : ''
},
email: data.profile._json.email,
profileId: data.profile.id,
username: data.profile.username,
avatar: data.profile._json.profile_image_url.replace('_normal', ''),
accessToken: data.accessToken,
refreshToken: data.refreshToken
};
return res.redirect(redirect);
})(req, res, next);
// Perform initial authentication request to Twitter
} else {
passport.authenticate('twitter')(req, res, next);
}
};