Compare commits

..

4 Commits

Author SHA1 Message Date
Gitea Actions Bot 4af3cc2486 chore: bump version to 1.0.45
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-07-15 20:45:45 +00:00
paul 3632b936e9 fix: improve URL slug generation for special characters
Mirror to GitHub / mirror (push) Successful in 20s
Test and Lint / backend-test (push) Successful in 1m6s
continuous-integration/drone/push Build is passing
Test and Lint / frontend-test (push) Successful in 2m6s
Version and Release / version-bump (push) Successful in 30s
Version and Release / trigger-drone (push) Successful in 2s
- Replace all non-alphanumeric characters with single dash
- Collapse multiple consecutive dashes into single dash
- Remove leading and trailing dashes
- Fixes issue where "Petra & Peter" became "petra---peter"
- Now generates cleaner URLs like "petra-peter" instead

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 22:41:25 +02:00
Gitea Actions Bot 66a6d4003a chore: bump version to 1.0.44
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-07-15 20:34:22 +00:00
paul bdf73c1f06 fix: properly allow date-based passwords for galleries
Mirror to GitHub / mirror (push) Successful in 23s
Test and Lint / backend-test (push) Successful in 1m6s
continuous-integration/drone/push Build is passing
Test and Lint / frontend-test (push) Successful in 2m9s
Version and Release / version-bump (push) Successful in 31s
Version and Release / trigger-drone (push) Successful in 3s
- Added skipStrengthCheck option to bypass zxcvbn analysis for gallery passwords
- Added explicit date pattern matching for formats like "04.07.2025"
- Date passwords (DD.MM.YYYY, DD/MM/YYYY, DD-MM-YYYY) are now automatically accepted
- Gallery passwords skip all strength requirements but maintain 6 character minimum
- Fixes production issue where date passwords were rejected by zxcvbn

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 22:29:58 +02:00
6 changed files with 37 additions and 9 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "picpeak-backend", "name": "picpeak-backend",
"version": "1.0.43", "version": "1.0.45",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "picpeak-backend", "name": "picpeak-backend",
"version": "1.0.43", "version": "1.0.45",
"dependencies": { "dependencies": {
"adm-zip": "^0.5.16", "adm-zip": "^0.5.16",
"archiver": "^5.3.1", "archiver": "^5.3.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "picpeak-backend", "name": "picpeak-backend",
"version": "1.0.43", "version": "1.0.45",
"description": "Backend for PicPeak event photo sharing platform", "description": "Backend for PicPeak event photo sharing platform",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
+6 -1
View File
@@ -66,7 +66,12 @@ router.post('/', adminAuth, [
} }
// Generate unique slug // Generate unique slug
const baseSlug = `${event_type}-${event_name.toLowerCase().replace(/[^a-z0-9]/g, '-')}-${event_date}`; const processedEventName = event_name
.toLowerCase()
.replace(/[^a-z0-9]/g, '-') // Replace non-alphanumeric with dash
.replace(/-+/g, '-') // Replace multiple dashes with single dash
.replace(/^-|-$/g, ''); // Remove leading/trailing dashes
const baseSlug = `${event_type}-${processedEventName}-${event_date}`;
let slug = baseSlug; let slug = baseSlug;
let counter = 1; let counter = 1;
+25 -2
View File
@@ -78,6 +78,16 @@ function validatePassword(password, options = {}) {
} }
} }
// Skip zxcvbn check if explicitly disabled (for gallery passwords)
if (options.skipStrengthCheck) {
return {
valid: errors.length === 0,
errors,
score: 2, // Default moderate score for gallery passwords
feedback: {}
};
}
// Use zxcvbn for strength analysis // Use zxcvbn for strength analysis
const strength = zxcvbn(password); const strength = zxcvbn(password);
@@ -121,19 +131,32 @@ function validatePasswordInContext(password, context, userData = {}) {
requireNumbers: false, // Numbers are optional requireNumbers: false, // Numbers are optional
requireSpecialChars: false, // Special chars are optional requireSpecialChars: false, // Special chars are optional
preventCommonPasswords: true, // Still prevent common passwords preventCommonPasswords: true, // Still prevent common passwords
minStrengthScore: 0 // Accept any score for galleries minStrengthScore: 0, // Accept any score for galleries
skipStrengthCheck: true // Skip zxcvbn strength analysis for galleries
}; };
// Base validation with gallery-specific options // Base validation with gallery-specific options
const result = validatePassword(password, galleryOptions); const result = validatePassword(password, galleryOptions);
// Override validation for common date formats
// Allow passwords like "04.07.2025", "04/07/2025", "04-07-2025"
const datePattern = /^\d{1,2}[.\/-]\d{1,2}[.\/-]\d{4}$/;
if (datePattern.test(password)) {
// Date format is valid for gallery passwords
return {
valid: true,
errors: [],
score: 2,
feedback: {}
};
}
// Additional gallery-specific checks // Additional gallery-specific checks
if (password.length < 6) { if (password.length < 6) {
result.valid = false; result.valid = false;
result.errors = ['Password must be at least 6 characters long']; result.errors = ['Password must be at least 6 characters long'];
} }
// Allow date-based passwords like "04.07.2025"
// Check if it's too simple (e.g., just "123456") // Check if it's too simple (e.g., just "123456")
if (/^\d{1,6}$/.test(password)) { if (/^\d{1,6}$/.test(password)) {
result.valid = false; result.valid = false;
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "picpeak-frontend", "name": "picpeak-frontend",
"version": "1.0.43", "version": "1.0.45",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "picpeak-frontend", "name": "picpeak-frontend",
"version": "1.0.43", "version": "1.0.45",
"dependencies": { "dependencies": {
"@tanstack/react-query": "^5.0.0", "@tanstack/react-query": "^5.0.0",
"@tiptap/extension-link": "^2.25.0", "@tiptap/extension-link": "^2.25.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "picpeak-frontend", "name": "picpeak-frontend",
"private": true, "private": true,
"version": "1.0.43", "version": "1.0.45",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",