Skip to content

Releases: Adiksuu/ValidAuth

ValidAuth v1.3.3

30 Nov 13:01

Choose a tag to compare

🎉 Release v1.3.2

Release Date: 25.11.2025

We're excited to announce validauth v1.3.3. It's QOL version, which adds better error handling

🔧 Improvements

  • Better error handling

📦 Installation & Upgrade

New Installation

npm install validauth

Upgrade from v1.3.2

npm update validauth

Breaking Changes: None! This release is fully backward compatible.


📊 Complete Feature List (v1.3.3)

Feature Status Docs
Email Validation 📖
Password Validation 📖
Password Strength Calculator 📖
Username Validation 📖
Password Match 📖
Password Generator 📖
OTP Validation 📖
OTP Generator 📖
Session Token Generator 📖
Session Token Validator 📖
XSS Protection Validator 📖

📖 Documentation


🤝 Contributing

Ways to contribute:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests
  • ⭐ Star the repo

💬 Feedback

We'd love to hear from you!


🙏 Thank You

A huge thank you to everyone who has contributed, reported issues, or provided feedback. Your support makes validauth better every day!

Special thanks to:

  • All our contributors
  • Everyone who reported bugs
  • Users who suggested features
  • Everyone who starred the repo ⭐

See full changelog


🔗 Links


Made with ❤️ by Adiksuu

Star us on GitHub if you find this useful!

ValidAuth v1.3.2

25 Nov 16:30

Choose a tag to compare

🎉 Release v1.3.2

Release Date: 25.11.2025

We're excited to announce validauth v1.3.2 with powerful new session token management and XSS protection features that further strengthen security and developer experience!


✨ What's New

🔑 Session Token Generator

Generate secure session tokens with customizable options for authentication and authorization!

import { generateSessionToken } from 'validauth';

// Generate with defaults (32 chars + timestamp)
const token = generateSessionToken();
console.log(token); // "AbCdEfGhIjKlMnOpQrStUvWxYz0123456789012345678901234567890"

// Custom length and options
const customToken = generateSessionToken({ 
  length: 20, 
  userID: 'user123', 
  expiresIn: '2h' 
});
console.log(customToken); // "AbCdEfGhIjKlMnOpQrSt1234567890user123"

// Get detailed info
const detailed = generateSessionToken({ 
  length: 16, 
  details: true,
  expiresIn: '30m'
});
console.log(detailed);
// {
//   token: "AbCdEfGhIjKlMnOp1234567890",
//   userID: null,
//   expiresIn: "30m",
//   length: 26,
//   timestamp: 1732549676627,
//   errors: null
// }

Options:

  • length - Random part length (default: 32, min: 16)
  • userID - User ID to append (default: null)
  • expiresIn - Expiration time (default: '1h', formats: '1s', '5m', '2h', '1d')
  • includeTimestamp - Include timestamp (default: true)
  • details - Return detailed info (default: false)

Use Cases:

  • User session management
  • API authentication tokens
  • Temporary access codes
  • Secure login sessions
  • Password reset tokens

📖 Full Documentation


✅ Session Token Validator

Validate session tokens for expiration and integrity checks!

import { isSessionTokenValid } from 'validauth';

// Simple validation
isSessionTokenValid(token); // true or false

// With userID validation
const valid = isSessionTokenValid(token, { 
  userID: 'user123',
  expiresIn: '2h'
}); // true

// Get detailed validation info
const result = isSessionTokenValid(token, { 
  details: true,
  expiresIn: '1h'
});
console.log(result);
// {
//   valid: true,
//   errors: null,
//   token: "...",
//   timestamp: 1732549676627,
//   expiresAt: 1732553276627,
//   remainingTime: 3600000
// }

// Handle expired token
const expired = isSessionTokenValid(oldToken, { details: true });
console.log(expired);
// {
//   valid: false,
//   errors: ['Token has expired'],
//   ...
// }

Options:

  • length - Expected random part length (default: 32)
  • userID - Expected user ID (default: null)
  • expiresIn - Expected expiration time (default: '1h')
  • includeTimestamp - Whether timestamp expected (default: true)
  • details - Return detailed info (default: false)

Use Cases:

  • Session validation middleware
  • API token verification
  • User authentication checks
  • Security token validation
  • Access control systems

📖 Full Documentation


🛡️ XSS Protection Validator

Detect potential XSS (Cross-Site Scripting) attacks in user input!

import { isXSSSafe } from 'validauth';

// Check safe content
isXSSSafe('Hello world'); // true
isXSSSafe('<strong>Safe HTML</strong>'); // true

// Detect XSS attempts
isXSSSafe('<script>alert("xss")</script>'); // false
isXSSSafe('<img src="x" onload="alert(1)" />'); // false
isXSSSafe('<a href="javascript:evil()">Click</a>'); // false

// Get detailed analysis
const result = isXSSSafe('<script>evil</script>', { details: true });
console.log(result);
// {
//   safe: false,
//   errors: ['Potential XSS detected: <script[^>]*>[\\s\\S]*?<\\/script>'],
//   input: '<script>evil</script>'
// }

Options:

  • details - Return detailed error info (default: false)

Detected Patterns:

  • <script> tags
  • JavaScript/VBScript protocols
  • Event handlers (onload, onerror, onclick, etc.)
  • Dangerous HTML elements (iframe, object, embed, etc.)
  • Meta/link/style injection attempts

Use Cases:

  • Form input sanitization
  • User-generated content validation
  • Comment system security
  • CMS content validation
  • API input filtering

📖 Full Documentation


🔧 Improvements

Security Enhancements

  • Session token validation prevents replay attacks
  • XSS detection blocks common injection vectors
  • Timestamp-based expiration for session tokens
  • Secure random generation for all tokens

Performance

  • Session token generation: < 2ms
  • Token validation: < 1ms
  • XSS checking: < 1ms
  • No performance impact on existing features

📦 Installation & Upgrade

New Installation

npm install validauth

Upgrade from v1.3.1

npm update validauth

Breaking Changes: None! This release is fully backward compatible.


📊 Complete Feature List (v1.3.2)

Feature Status Docs
Email Validation 📖
Password Validation 📖
Password Strength Calculator 📖
Username Validation 📖
Password Match 📖
Password Generator 📖
OTP Validation 📖
OTP Generator 📖
Session Token Generator ✅ NEW 📖
Session Token Validator ✅ NEW 📖
XSS Protection Validator ✅ NEW 📖

📖 Documentation


🤝 Contributing

Ways to contribute:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests
  • ⭐ Star the repo

💬 Feedback

We'd love to hear from you!


🙏 Thank You

A huge thank you to everyone who has contributed, reported issues, or provided feedback. Your support makes validauth better every day!

Special thanks to:

  • All our contributors
  • Everyone who reported bugs
  • Users who suggested features
  • Everyone who starred the repo ⭐

See full changelog


🔗 Links


Made with ❤️ by Adiksuu

Star us on GitHub if you find this useful!

ValidAuth v1.3.1

24 Nov 20:29

Choose a tag to compare

🎉 Release v1.3.1

Release Date: 24.11.2025

We're thrilled to announce validauth v1.3.1 with exciting new OTP (One-Time Password) features that enhance security and user experience!


✨ What's New

🔢 OTP Generator

Generate secure one-time passwords with customizable length and character types!

import { generateOTP } from 'validauth';

// Generate with defaults (4 characters, numeric)
const otp = generateOTP();
console.log(otp); // "4829"

// Custom length and type
const longOTP = generateOTP({ length: 8, type: 'alphanumeric' });
console.log(longOTP); // "A7k9Mn2x"

// Get detailed info
const detailed = generateOTP({ 
  length: 6, 
  type: 'numeric', 
  details: true 
});
console.log(detailed);
// {
//   code: "482917",
//   length: 6,
//   type: "numeric"
// }

Options:

  • length - OTP length (default: 4)
  • type - Character type: 'numeric' or 'alphanumeric' (default: 'numeric')
  • details - Return detailed info (default: false)

Use Cases:

  • SMS verification codes
  • Email confirmation tokens
  • Two-factor authentication
  • Password reset tokens
  • Admin access codes

📖 Full Documentation


🔐 OTP Validation

Validate one-time passwords with attempt tracking and security checks!

import { validateOTP } from 'validauth';

// Simple validation
validateOTP('1234', '1234'); // true
validateOTP('1234', '5678'); // false

// With attempt tracking
const result = validateOTP('1234', '1234', { 
  attempts: 1, 
  maxAttempts: 3, 
  details: true 
});
console.log(result);
// {
//   valid: true,
//   errors: null,
//   otp: '1234',
//   correctOTP: '1234',
//   attempts: 1,
//   remainingAttempts: 2,
//   maxAttempts: 3
// }

// Handle failed attempts
const failed = validateOTP('wrong', 'correct', { 
  attempts: 4, 
  maxAttempts: 3, 
  details: true 
});
console.log(failed);
// {
//   valid: false,
//   errors: ['Invalid OTP.', 'Max attempts exceeded.'],
//   otp: 'wrong',
//   correctOTP: 'correct',
//   attempts: 4,
//   remainingAttempts: -1,
//   maxAttempts: 3
// }

Options:

  • attempts - Current attempt count
  • maxAttempts - Maximum allowed attempts (default: 3)
  • details - Return detailed validation info (default: false)

Use Cases:

  • Two-factor authentication verification
  • Password reset confirmation
  • Account security validation
  • Admin panel access control
  • API rate limiting integration

📖 Full Documentation


🔧 Improvements

Performance

  • OTP generation: < 1ms
  • OTP validation: < 1ms
  • Enhanced security with attempt tracking
  • No performance regression on existing validators

📦 Installation & Upgrade

New Installation

npm install validauth

Upgrade from v1.3.0

npm update validauth

Breaking Changes: None! This release is fully backward compatible.


📊 Complete Feature List (v1.3.1)

Feature Status Docs
Email Validation 📖
Password Validation 📖
Password Strength Calculator 📖
Username Validation 📖
Password Match 📖
Password Generator 📖
OTP Validation ✅ NEW 📖
OTP Generator ✅ NEW 📖

📖 Documentation


🤝 Contributing

Ways to contribute:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests
  • ⭐ Star the repo

💬 Feedback

We'd love to hear from you!


🙏 Thank You

A huge thank you to everyone who has contributed, reported issues, or provided feedback. Your support makes validauth better every day!

Special thanks to:

  • All our contributors
  • Everyone who reported bugs
  • Users who suggested features
  • Everyone who starred the repo ⭐

See full changelog


🔗 Links


Made with ❤️ by Adiksuu

Star us on GitHub if you find this useful!

ValidAuth v1.3.0

23 Nov 20:49

Choose a tag to compare

🎉 Release v1.3.0

Release Date: 23.11.2025

We're excited to announce validauth v1.3.0 with powerful new features that make authentication validation even easier!


✨ What's New

🔄 Password Match Validation

Compare passwords to ensure they match - perfect for "confirm password" fields!

import { isPasswordMatch } from 'validauth';

// Simple validation
isPasswordMatch('MyP@ssw0rd123', 'MyP@ssw0rd123'); // true
isPasswordMatch('Password1', 'Password2'); // false

// Get detailed feedback
const result = isPasswordMatch('Pass1', 'Pass2', { details: true });
console.log(result);
// {
//   match: false,
//   errors: ['Passwords do not match']
// }

Use Cases:

  • Registration forms
  • Password change forms
  • Password reset flows
  • Account settings

📖 Full Documentation


🔑 Password Generator

Generate strong, random passwords with customizable criteria!

import { generatePassword } from 'validauth';

// Generate with defaults (12 characters, all types)
const password = generatePassword();
console.log(password); // "Kp9$mN2@xL5v"

// Custom length
const long = generatePassword({ options: { length: 20 } });

// Without symbols (easier to type)
const simple = generatePassword({ 
  options: { 
    length: 12,
    includeSymbols: false 
  } 
});

// Get detailed info including strength
const detailed = generatePassword({ 
  options: { 
    length: 16,
    details: true 
  } 
});
console.log(detailed);
// {
//   password: "Kp9$mN2@xL5vPr3!",
//   length: 16,
//   errors: [],
//   strength: {
//     score: 95,
//     level: 'strong',
//     feedback: [],
//     crackTime: '1000 years'
//   }
// }

Options:

  • length - Password length (default: 12)
  • includeUppercase - Include uppercase letters (default: true)
  • includeLowercase - Include lowercase letters (default: true)
  • includeNumbers - Include numbers (default: true)
  • includeSymbols - Include symbols (default: true)
  • details - Return detailed info with strength analysis (default: false)

Use Cases:

  • Password reset features
  • Temporary account creation
  • Password generator UI
  • Bulk password generation

📖 Full Documentation


🔧 Improvements

Performance

  • Password generation: < 1ms
  • Password match validation: < 0.1ms
  • No performance regression on existing validators

📦 Installation & Upgrade

New Installation

npm install validauth

Upgrade from v1.2.x

npm update validauth

Breaking Changes: None! This release is fully backward compatible.


📊 Complete Feature List (v1.3.0)

Feature Status Docs
Email Validation 📖
Password Validation 📖
Password Strength Calculator 📖
Username Validation 📖
Password Match ✅ NEW 📖
Password Generator ✅ NEW 📖

📖 Documentation


🤝 Contributing

Ways to contribute:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests
  • ⭐ Star the repo

💬 Feedback

We'd love to hear from you!


🙏 Thank You

A huge thank you to everyone who has contributed, reported issues, or provided feedback. Your support makes validauth better every day!

Special thanks to:

  • All our contributors
  • Everyone who reported bugs
  • Users who suggested features
  • Everyone who starred the repo ⭐

See full changelog


🔗 Links


Made with ❤️ by Adiksuu

Star us on GitHub if you find this useful!

ValidAuth v1.2.1

23 Nov 18:13

Choose a tag to compare

Optimized the package size from 1.2MB to 50kb (unpacked)