fix(api): resolve registration 404 + bcrypt/passlib incompatibility#65
fix(api): resolve registration 404 + bcrypt/passlib incompatibility#65
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove duplicate router prefixes from 5 route files (auth, users, projects, themes, exports) — each had an internal prefix that doubled the prefix already set in app/main.py, causing all endpoints to 404 - Run alembic upgrade head to actually create DB tables (DB was only stamped, not migrated) - Replace passlib CryptContext with direct bcrypt calls in security.py and auth_service.py — passlib 1.7.4 is incompatible with bcrypt 4.x/5.x (chromadb requires bcrypt>=4.0.1, so passlib must be bypassed) - Fix secrets.urlsafe_b64encode → base64.urlsafe_b64encode in email_service.py - Fix SecurityEvent(metadata=) → event_metadata= (column was renamed) - Add FRONTEND_URL field to Settings (missing, used by email verification URL) Registration now returns 201 with user_id and verification_required=true. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
User description
Summary
app/main.py, resulting in paths like/api/auth/auth/registeralembic upgrade headto actually create all tableschromadbrequiresbcrypt>=4.0.1); replaced passlibCryptContextwith directbcryptcalls insecurity.pyandauth_service.pysecrets.urlsafe_b64encode→base64.urlsafe_b64encodeinemail_service.pySecurityEvent(metadata=)→event_metadata=(column was renamed to avoid SQLAlchemy reserved name)FRONTEND_URLtoSettings(was missing, used in email verification link)Test plan
POST /api/auth/registerreturns 201 withuser_idandverification_required: true🤖 Generated with Claude Code
PR Type
Bug fix, Enhancement
Description
Removed duplicate router prefixes from 5 route files (auth, users, projects, themes, exports) that caused all API endpoints to return 404
Replaced passlib CryptContext with direct bcrypt calls to resolve incompatibility with bcrypt 4.x/5.x required by chromadb
Fixed base64 encoding in email_service.py (secrets.urlsafe_b64encode → base64.urlsafe_b64encode)
Renamed reserved SQLAlchemy column metadata → event_metadata in SecurityEvent model
Added missing FRONTEND_URL configuration field to Settings
Updated session state documentation with deployment status and outstanding issues
Diagram Walkthrough
File Walkthrough
8 files
Remove duplicate /auth prefix from routerRemove duplicate /users prefix from routerRemove duplicate /projects prefix from routerRemove duplicate /themes prefix from routerRemove duplicate /exports prefix from routerReplace passlib with direct bcrypt implementationReplace passlib with direct bcrypt in registration and authenticationFix base64 encoding and SecurityEvent metadata column name1 files
Add missing FRONTEND_URL configuration setting2 files
Update session state with deployment and system statusAdd comprehensive session log and outstanding issues