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

feathers-authentication

Package Overview
Dependencies
Maintainers
3
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-authentication - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

17

lib/hooks/set-user-id.js

@@ -22,4 +22,19 @@ 'use strict';

return function (hook) {
function setId(obj) {
obj[destProp] = hook.params.user[sourceProp];
}
if (hook.params.user) {
hook.data[destProp] = hook.params.user[sourceProp];
// Handle arrays.
if (Array.isArray(hook.data)) {
hook.data.forEach(function (item) {
setId(item);
});
// Handle single objects.
} else {
setId(hook.data);
}
} else {

@@ -26,0 +41,0 @@ throw new Error('There is no user logged in.');

24

lib/hooks/to-lower-case.js

@@ -17,9 +17,23 @@ 'use strict';

}
function convert(obj) {
if (obj[fieldName] && obj[fieldName].toLowercase) {
obj[fieldName] = obj[fieldName].toLowerCase();
}
}
return function (hook) {
var location = hook.type === 'before' ? 'data' : 'params';
// Allow user to view records without a userId.
if (hook[location][fieldName] && hook[location][fieldName].toLowercase) {
hook[location][fieldName] = hook[location][fieldName].toLowerCase();
}
var location = hook.type === 'before' ? 'data' : 'result';
// Handle arrays.
if (Array.isArray(hook[location])) {
hook[location].forEach(function (item) {
convert(item);
});
// Handle Single Objects.
} else {
convert(hook[location]);
}
};
}
{
"name": "feathers-authentication",
"description": "Add Authentication to your FeathersJS app.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/feathersjs/feathers-authentication",

@@ -6,0 +6,0 @@ "main": "lib/",

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