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

baucis-decorator-guests

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

baucis-decorator-guests

Automatically creates unauthenticated users as guests and reserves guest names.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

baucis-decorator-guests

Automatically creates unauthenticated users as guests and reserves guest names.

Install

npm install baucis-decorators baucis-decorator-guests --save

Usage

Just add the decorator with your Express app instance and it should work. Works with baucis-decorator-auth, so using mongoose as your session store may be required.

Example

controllers/User.js

var baucis = require('baucis');
var ResourceController = require('../controllers/Resource.js');

// ensure model is initialized
var UserModel = require('../models/User.js');
var UserController = baucis.rest('User');

var decorators = require('baucis-decorators');
var guests = require('baucis-decorator-guests');
var app = require('../server/app.js');

// decorate controller
decorators.add.call(UserController, [
  guests(app),        // upon every request, creates a guest `User` if `req.session.userId` is undefined
  ResourceController  // `UserController` will inherit all of `ResourceController`'s decorators
]);

/**
 * Expose controller.
 */
module.exports = UserController;

Keywords

FAQs

Package last updated on 05 Jun 2015

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