-
Notifications
You must be signed in to change notification settings - Fork 0
Add and fix a bunch of stuff #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements email update functionality with OTP verification, adds support for demo URLs in projects, improves the Hackatime API integration, and includes various API improvements and refactoring. The changes introduce a two-step email update flow where users request a change and verify it via OTP, similar to the existing authentication flow.
Key changes:
- Email update flow: Users can now update their email via PATCH
/api/users/me, triggering an OTP verification process - Demo URL support: Projects now support an optional
demo_urlfield alongside existingrepoandpreview_imagefields - Hackatime integration: New
get_projectsfunction to fetch project statistics from the Hackatime API - API improvements: Added GET
/api/users/meendpoint, refactored project update logic for better clarity, and updated response formats to remove redundantsuccessflags
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| v1/users/main.py | Added UserResponse model, implemented GET /api/users/me endpoint, refactored update_user to use OTP-based email changes, removed unused imports |
| v1/projects/main.py | Added demo_url field support throughout project endpoints, refactored update_project to use explicit field updates instead of loop-based approach, made repo/preview_image optional in create |
| v1/models/user.py | Added demo_url column to UserProject model |
| v1/lib/hackatime.py | Added get_projects function with documentation, fixed CUTOFF_DATE format, added HACKATIME_API_URL constant (includes debug print statement) |
| v1/auth/main.py | Refactored send_otp to extract send_otp_code helper function, modified OTP storage to include old_email for email updates, implemented email update logic in validate_otp |
| v1/auth/otp.html | New HTML email template for OTP codes with styled layout |
| v1/auth/init.py | Exported send_otp_code function for use in other modules |
| static/projectstest.html | Fixed endpoint URL from /api/projects/create to /api/projects |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
will make the /v1 to /api/v1 refactor be a separate PR so this isn't impossible to review |
thesleepyniko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
New OTP email: (in Proton mail)

Changes: