I see the issue! The login functionality has a few problems. Let me fix the authentication flow and make sure everything works properly.
The main issues were:
Run the password update script:
psql -d store_rating_db -f scripts/003-update-passwords.sqlOr generate a proper hash using the script:
node scripts/generate-hash.jsTest with these credentials:
admin@storerating.comPassword123!The login should now work properly! The form also shows test credentials for easy testing.
To configure the generation, complete these steps:
The error indicates there's a JSON parsing issue in the login response. Let me fix the authentication flow and ensure proper JSON responses.
The main fixes:
Run the password hashing script:
node scripts/hash-passwords.jshttp://localhost:3000/api/test to verify the database is workingTry logging in with:
admin@storerating.comPassword123!The error should now be resolved, and you should see proper error messages if there are any remaining issues.
To configure the generation, complete these steps:
scripts/hash-passwords.jsGenerated hash for password 'Password123!': $2b$10$Po4MLVUgZj2rWve6VKZnHOM44S6LuGrJQekJwEHZriDb0OHGih1Su scripts/hash-passwords.jsError updating passwords: Error: connect ECONNREFUSED 127.0.0.1:5432 at [90m/home/user/[39mnode_modules/[4mpg-pool[24m/index.js:45:11 [90m at process.processTicksAndRejections (node:internal/process/task_queues:105:5)[39m at async updatePasswords ([eval]:25:7) { errno: [33m-111[39m, code: [32m'ECONNREFUSED'[39m, syscall: [32m'connect'[39m, address: [32m'127.0.0.1'[39m, port: [33m5432[39m }
You can send messages while the preview loads