Skip to content

Conversation

@ImShyMike
Copy link
Member

@ImShyMike ImShyMike commented Dec 6, 2025

New OTP email: (in Proton mail)
image

Changes:

  • add demo_url to project
  • make the OTP email better
  • use direct model updating instead of setattr
  • add get hackatime projects helper
  • add email validation before changing email
  • added get user info endpoint

@ImShyMike ImShyMike marked this pull request as draft December 6, 2025 16:53
Copy link
Contributor

Copilot AI left a 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_url field alongside existing repo and preview_image fields
  • Hackatime integration: New get_projects function to fetch project statistics from the Hackatime API
  • API improvements: Added GET /api/users/me endpoint, refactored project update logic for better clarity, and updated response formats to remove redundant success flags

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.

@ImShyMike ImShyMike marked this pull request as ready for review December 6, 2025 21:44
@ImShyMike ImShyMike self-assigned this Dec 6, 2025
@ImShyMike
Copy link
Member Author

will make the /v1 to /api/v1 refactor be a separate PR so this isn't impossible to review

@ImShyMike ImShyMike requested a review from jleuth December 6, 2025 21:48
@ImShyMike ImShyMike removed the request for review from jleuth December 6, 2025 21:58
Copy link
Collaborator

@thesleepyniko thesleepyniko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@ImShyMike ImShyMike merged commit b84d4d3 into main Dec 6, 2025
2 checks passed
@ImShyMike ImShyMike deleted the stuff branch December 7, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants