
Research
Security News
Malicious npm Package Wipes Codebases with Remote Trigger
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
@3merge/express-auth-middleware
Advanced tools
Work in progress!
Discriminating the user model, the preferred approach, assigns a kind
property to all documents. I recommend using the decorator functions in this module to get/set properties in the base as well.
Property | Type | Description | Default |
---|---|---|---|
active | boolean | System-generated to keep track of "deleted" users | true |
email* | string | Self-explanatory | null |
firstName* | string | Self-explanatory | null |
frozen | boolean | Somewhat of an alias for active, only setting it does not affect other properties | false |
lang | string | The preferred locale (en-CA or fr-CA ). | en-CA |
lastName* | string | Self-explanatory | null |
loginAttempts | number | Used to block excessive login attempts (< 5) | 0 |
password | password | Used to authenticate | null |
secret* | string | Used to read and write JWT tokens. Nullifying this would destroy all active sessions | null |
verified | boolean | Represents the validity of an email address. Login attempts are blocked without verification | false |
Name | Description | Return |
---|---|---|
await Model.findByEmail(string) | Lookup active users by email address | object |
await Model.findUnverifiedByEmail(string) | Lookup unverified users by email | object |
await Model.findVerifiedByEmail(string) | Lookup verified users by email | object |
await Model.findVerifiedById(string) | Lookup verified users by id | object |
await doc.setSecret() | Generate secret token | object |
await doc.verifyPassword(string, boolean) | Compare string against stored password. Throws error if second parameter is true | boolean |
await doc.deactivate() | Deletes a user for most intents-and-purposes | object |
doc.isBlocked | Is the user allowed to login? | boolean |
doc.hasExpired | Has more than 24 hours elapsed since requesting verification? | boolean |
doc.isPermitted | Does the user have all the necessary properties to login? | boolean |
FAQs
Authentication middleware for Express APIs
The npm package @3merge/express-auth-middleware receives a total of 1 weekly downloads. As such, @3merge/express-auth-middleware popularity was classified as not popular.
We found that @3merge/express-auth-middleware 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.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.
Security News
New CNA status enables OpenJS Foundation to assign CVEs for security vulnerabilities in projects like ESLint, Fastify, Electron, and others, while leaving disclosure responsibility with individual maintainers.