use @passport-js/passport-twitter

This commit is contained in:
Paul Rodwell 2023-02-07 11:24:58 +00:00
parent f04c99a73d
commit 40afd20e4f
No known key found for this signature in database
GPG Key ID: 083BA337597C49E6
3 changed files with 119 additions and 3306 deletions

3416
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
"author": "Paul Rodwell <paul.rodwell@btinternet.com> (http://rodwell.me)",
"license": "MIT",
"dependencies": {
"@passport-js/passport-twitter": "^1.0.8",
"coffeescript": "^2.4.1",
"es6-promise": "^4.2.8",
"lodash": "^4.17.19",
@ -12,7 +13,6 @@
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
"passport-oauth2": "^1.6.1",
"passport-twitter": "github:paul90/passport-twitter#48b52556f48e4e8f7c55288baaf3ba3076eeba16",
"persona-pass": "^0.2.1",
"qs": "^6.7.0",
"whatwg-fetch": "^3.2.0"

View File

@ -288,7 +288,7 @@ module.exports = exports = (log, loga, argv) ->
# Twitter Strategy
if argv.twitter_consumerKey? and argv.twitter_consumerSecret?
ids.push('twitter')
TwitterStrategy = require('passport-twitter').Strategy
TwitterStrategy = require('@passport-js/passport-twitter').Strategy
twitterStrategyName = callbackHost + 'Twitter'
@ -357,7 +357,10 @@ module.exports = exports = (log, loga, argv) ->
# Twitter
app.get('/auth/twitter', passport.authenticate(twitterStrategyName), (req, res) -> )
app.get('/auth/twitter/callback',
passport.authenticate(twitterStrategyName, { successRedirect: '/auth/loginDone', failureRedirect: '/auth/loginDialog'}))
passport.authenticate(twitterStrategyName, { failureRedirect: '/auth/loginDialog'}),
(req, res) ->
res.redirect('/auth/loginDone')
)
# Google
app.get('/auth/google', passport.authenticate(googleStrategyName, { scope: [