![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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_CREDENTIALS
await 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_TOKEN
await 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_TOKEN
INVALID_CREDENTIALS
await 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_FOUND
await auth.requestResetPassword({
subject: '507f1f77bcf86cd799439011',
});
Reset password.
string
Request token.string | number
(Optional) ID of the owner of the requestToken.string
New Password.INVALID_TOKEN
await 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
The npm package highoutput-auth receives a total of 16 weekly downloads. As such, highoutput-auth popularity was classified as not popular.
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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.