Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
cantina-auth-twitter
Advanced tools
Twitter authentication for Cantina.
authURL
route.Defaults
{
'auth-twitter': {
successRedirect: '/',
failureRedirect: '/',
authURL: '/login'
}
}
Your application MUST provide handlers for serializing, deserializing, and verifying users.
app.serializeUser
app.deserializeUser
app.verifyTwitterUser
var app = require('cantina').createApp();
app.boot(function(err) {
if (err) return console.error(err);
app.conf.set('http:port', 3000);
app.conf.set('auth-twitter', {
consumerKey: 'consumer key here',
consumerSecret: 'consumer secret here',
callbackURL: 'http://localhost:3000/auth/twitter/callback',
authURL: '/login'
});
app.serializeUser = function(user, cb) {
return cb(null, user.id);
};
app.deserializeUser = function(obj, cb) {
return cb(null, obj);
};
app.verifyTwitterUser = function(token, tokenSecret, profile, done) {
return done(null, profile);
};
app.require('cantina-web');
app.require('cantina-redis');
app.require('cantina-session');
app.require('cantina-auth');
app.require('cantina-auth-twitter');
app.start(function(err) {
if (err) return console.log(err);
app.middleware.get('/', function index(req, res) {
res.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});
if (req.isAuthenticated()) {
res.end('Welcome, <a href="https://twitter.com/' + req.user.username + '">' + req.user.displayName + '</a>!');
}
else {
res.end('<a href="/login">click here to login via Twitter</a>');
}
});
});
});
Terra Eclipse, Inc. is a nationally recognized political technology and strategy firm located in Santa Cruz, CA and Washington, D.C.
FAQs
Twitter authentication for cantina
The npm package cantina-auth-twitter receives a total of 1 weekly downloads. As such, cantina-auth-twitter popularity was classified as not popular.
We found that cantina-auth-twitter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.