New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

passport-coola

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-coola

CoolaData authentication strategy for Passport.

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

passport-coola

Passport strategy for authenticating with cookies.

This module lets you authenticate using a cooladata access token in your Node.js applications. By plugging into Passport, coola authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Install

$ npm install passport-coola

Usage

Configure Strategy

The coola authentication strategy authenticates users using cooladata access token. The strategy requires a verify callback, which accepts these credentials and calls done providing a user.

passport.use(new CoolaStrategy(
  function(token, done, req) {
  	Auth.verifyToken(token, function (err, user) {
      if (err) { return done(err); }
      if (!user) { return done(null, false); }
      return done(null, user);
    });
  }
));
Authenticate Requests

Use passport.authenticate(), specifying the 'coola' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.get('/auth', 
  passport.authenticate('coola'),
  function(req, res) {
    res.redirect('/');
  });

Tests

$ npm install
$ npm test

Credits

License

The MIT License

Copyright (c) 2014 CoolaData <http://www.cooladata.com/>

Keywords

FAQs

Package last updated on 17 Nov 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc