A modern authentication system for alt:V multiplayer modification, featuring user registration and login functionality with MySQL database integration.
- User registration with email verification
- Secure password hashing using SHA256
- MySQL database integration
- Modern and responsive UI
- Email validation
- Password strength requirements
- Animated camera during authentication
- Player state management
- Error handling and validation
- Node.js
- MySQL Server
- Required npm packages:
- crypto-js
- mysql2
- Copy the
authfolder to your server'sresourcesdirectory - Configure your MySQL database settings in
server/database.js:
const dbConfig = { host: 'your_host', user: 'your_username', password: 'your_password', database: 'your_database' };- Install dependencies:
cd resources/auth npm install- Add the resource to your
server.toml:
resources = [ 'auth' ]The system automatically creates the following table structure:
CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) UNIQUE NOT NULL, email VARCHAR(100) UNIQUE NOT NULL, password_hash VARCHAR(255) NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, last_login TIMESTAMP NULL )- Password minimum length: 6 characters
- Email format validation
- Unique username and email constraints
- Password hashing using SHA256
Players can register with:
- Username
- Email address
- Password (minimum 6 characters)
- Password confirmation
Players can log in using:
- Username
- Password
auth:showLoginFormauth:loginResponseauth:registerResponse
auth:tryLoginauth:tryRegister
- Missing fields
- Invalid email format
- Password mismatch
- Duplicate username/email
- Database connection issues
- Authentication failures