Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-user

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-user - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

package.json
{
"name": "express-user",
"version": "1.0.1",
"version": "1.0.2",
"description": "Ressource Oriented Express Middleware to Manage Users.",

@@ -35,3 +35,4 @@ "keywords": [

"nodeunit": "~0.9.0",
"user-store": "^1.3.0"
"user-properties": "^3.1.0",
"user-store": "^2.0.0"
},

@@ -38,0 +39,0 @@ "license": "MIT",

46

README.md

@@ -233,6 +233,42 @@ Express-User

Otherwise, the retrieved user is stored in the property res.locals.ExpressUser.Result.
Otherwise, the retrieved user (object with the user's properties as its properties) is stored in the property res.locals.ExpressUser.Result.
...
- GET /Users/:Field/:ID/Count
If no error was encountered while manipulating the store, but the user was not found, an error route will be triggered with Err.Source having the value of 'ExpressUser' and Err.Type having the value of 'NoUser'.
Otherwise, the count of users satisfying the selection (numerical primitive) is stored in the property res.locals.ExpressUser.Result.
- PUT /User/Self/Memberships/:Membership and PUT /User/:Field/:ID/Memberships/:Membership
If no error was encountered while manipulating the store, but the user to insert the membership to was not found, an error route will be triggered with Err.Source having the value of 'ExpressUser' and Err.Type having the value of 'NoInsertion'.
Otherwise, no propertie are set.
Currently, express-user doesn't provide feedback to indicate that a membership insertion did nothing due to the membership already being present.
- DELETE /User/Self/Memberships/:Membership and DELETE /User/:Field/:ID/Memberships/:Membership
If no error was encountered while manipulating the store, but the user to remove the membership from was not found, an error route will be triggered with Err.Source having the value of 'ExpressUser' and Err.Type having the value of 'NoDeletion'.
Otherwise, no propertie are set.
Currently, express-user doesn't provide feedback to indicate that a membership removal did nothing due to the membership already being absent.
- POST /User/Self/Recovery/:SetField and POST /User/:Field/:ID/Recovery/:SetField
Same as PATCH /User/Self and PATCH /User/:Field/:ID
- PUT /Session/Self/User
If no error was encountered while manipulating the store, but the user to insert into the session was not found, an error route will be triggered with Err.Source having the value of 'ExpressUser' and Err.Type having the value of 'NoUser'.
Otherwise, no propertie are set.
- DELETE /Session/Self/User
If the req.session.User is a falsey value, an error route will be triggered with Err.Source having the value of 'ExpressUser' and Err.Type having the value of 'NoSessionUser'.
Otherwise, no propertie are set.
- Further Note

@@ -325,2 +361,8 @@

1.0.2
-----
- Added user-properties to dev dependencies
- Updated user-store dev dependency to version 2.0.0 and adjusted tests accordingly
- Finished doc
1.0.1

@@ -327,0 +369,0 @@ -----

@@ -8,2 +8,3 @@ //Copyright (c) 2015 Eric Vallee <eric_vallee2003@yahoo.ca>

var ExpressUser = require('../lib/ExpressUser');
var UserProperties = require('user-properties');
var UserStore = require('user-store');

@@ -32,4 +33,7 @@ var MongoDB = require('mongodb');

{
var UserSchema = UserProperties({'Email': {'Required': true, 'Unique': true, 'Privacy': UserProperties.Privacy.Private},
'Username': {'Required': true, 'Unique': true, 'Privacy': UserProperties.Privacy.Public},
'Password': {'Required': true, 'Privacy': UserProperties.Privacy.Secret, 'Retrievable': false}});
MongoDB.MongoClient.connect("mongodb://localhost:27017/"+RandomIdentifier, {native_parser:true}, function(Err, DB) {
UserStore(DB, {'Email': {'Unique': 1, 'NotNull': 1}, 'Username': {'Unique': 1, 'NotNull': 1}, 'Password': {'NotNull': 1}}, function(Err, UserStoreInst) {
UserStore(DB, UserSchema, function(Err, UserStoreInst) {
SessionStore(DB, function(Err, SessionStoreInst) {

@@ -36,0 +40,0 @@ Context['DB'] = DB;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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