mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 01:37:48 -05:00
Add basic tweet-bot stuff
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
"mongoose": "5.11.10",
|
||||
"node-mailjet": "3.3.1",
|
||||
"passport": "0.4.1",
|
||||
"passport-local": "1.0.0"
|
||||
"passport-local": "1.0.0",
|
||||
"passport-twitter": "1.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
19
account/server/config/passport-strategies/twitter.js
Normal file
19
account/server/config/passport-strategies/twitter.js
Normal file
@@ -0,0 +1,19 @@
|
||||
var Strategy = require('passport-twitter').Strategy;
|
||||
const User = require("../../models/user");
|
||||
|
||||
const twitter = new Strategy({
|
||||
consumerKey: process.env['TWITTER_CONSUMER_KEY'],
|
||||
consumerSecret: process.env['TWITTER_CONSUMER_SECRET'],
|
||||
callbackURL: '/oauth/callback',
|
||||
proxy: trustProxy
|
||||
},
|
||||
function(token, tokenSecret, profile, cb) {
|
||||
// In this example, the user's Twitter profile is supplied as the user
|
||||
// record. In a production-quality application, the Twitter profile should
|
||||
// be associated with a user record in the application's database, which
|
||||
// allows for account linking and authentication with other identity
|
||||
// providers.
|
||||
return cb(null, profile);
|
||||
})
|
||||
|
||||
module.exports = local;
|
||||
@@ -1,6 +1,7 @@
|
||||
/* Initializing PassportJS */
|
||||
const User = require("../models/user");
|
||||
const local = require("./passport-strategies/local");
|
||||
const twitter = require("./passport-strategies/twitter");
|
||||
|
||||
module.exports = function (app, passport) {
|
||||
// Configure Passport authenticated session persistence.
|
||||
|
||||
Reference in New Issue
Block a user