
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
highoutput-auth
Advanced tools
The Auth constructor accepts the following configuration
string Secret key to use in generating the JWT.model User model.import mongoose, { Schema } from 'mongoose';
import Auth from 'highoutput-auth';
const AccountModel = {
async findByUsername(username) => { ... },
async findById(id) => { ... },
async updatePassword(id, password) => { ... },
};
const auth = new Auth({
secretKey: '4fb473f82ba47bf6acbab33e7529fb96',
model: AccountModel
});
Create an access token.
string Username.string Password.string (Optional) Amount of time before the accessToken expires. Must be compatible to the ms package.object (Optional) Additional claims to include in the JWT.Promise<string>INVALID_CREDENTIALSawait auth.createAccessToken({
username: 'roger',
password: '123456Seven',
});
Verify a json web token.
string Access token.string | number (Optional) ID of the owner of the accessToken.Promise<object> Claims stored in the JWT.INVALID_TOKENawait auth.verifyAccessToken({
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1YWQ3MTZlZjc1ZTZhODc1MTQ0Y2Q0NDQiLCJpYXQiOjE1MjQ2MjYzNjMsImV4cCI6MTUyNTIzMTE2M30.z2xgs0BeLQsTBiG9sphjkP_JljYht2o4AgI4ClWgZqw',
});
Change the user password.
string Access token.string | number (Optional) ID of the owner of the accessToken.string Old password.string New Password.INVALID_TOKENINVALID_CREDENTIALSawait auth.changePassword({
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1YWQ3MTZlZjc1ZTZhODc1MTQ0Y2Q0NDQiLCJpYXQiOjE1MjQ2MjYzNjMsImV4cCI6MTUyNTIzMTE2M30.z2xgs0BeLQsTBiG9sphjkP_JljYht2o4AgI4ClWgZqw',
oldPassword: 'password',
newPassword: '123456Seven',
});
Request for a password reset.
string | number ID of the user requesting the password reset.string (Optional) Amount of time before the requestToken expires.Promise<string>USER_NOT_FOUNDawait auth.requestResetPassword({
subject: '507f1f77bcf86cd799439011',
});
Reset password.
string Request token.string | number (Optional) ID of the owner of the requestToken.string New Password.INVALID_TOKENawait auth.resetPassword({
requestToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1YWQ3MTZlZjc1ZTZhODc1MTQ0Y2Q0NDQiLCJpYXQiOjE1MjQ2MjYzNjMsImV4cCI6MTUyNTIzMTE2M30.z2xgs0BeLQsTBiG9sphjkP_JljYht2o4AgI4ClWgZqw',
password: '123456Seven',
});
The model should have the following methods
Promise<{ id: string | number, username: string, password: string }>Promise<{ id: string | number, username: string, password: string }>Promise<void>const { bcrypt } = require('highoutput-auth');
const R = require('ramda');
class Model {
constructor() {
this.users = [];
}
/* additional method for the sake of context */
async insertUser(user) {
this.users.push({
...user,
password: await bcrypt.hash(user.password),
});
}
async findByUsername(username) {
return R.find(R.propEq('username', username))(this.users);
}
async findById(id) {
return R.find(R.propEq('id', id))(this.users);
}
async updatePassword(id, password) {
const user = R.find(R.propEq('id', id))(this.users);
if (!user) {
return;
}
user.password = password;
}
}
FAQs
Authentication and authorization module
We found that highoutput-auth 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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.