Skip to content

Conversation

@uwwint
Copy link
Collaborator

@uwwint uwwint commented Nov 20, 2025

Description

AAI-433: Allow Update of email on user profile page
AAI-475: Allow Update of full name on user profile page

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit / integration tests that prove my fix is effective or that my feature works
  • I have run all tests locally and they pass
  • I have updated the documentation (if applicable)
  • For any new secrets, I have updated the shared spreadsheet and the GitHub Secrets.

How to Test Manually

needs newest backend, then login as a user and change password/username/full name or email. ensure the values are updated in auth0

Screenshots for any UI changes

<img width="1678" height="1173" alt="Screenshot 2025-11-20 at 23 40 00" src="https://github.com/user-attachments/assets/fbe5dcfd-cc9
Screenshot 2025-11-20 at 23 39 55
b-4920-98e2-9
Screenshot 2025-11-20 at 23 39 40

Screenshot 2025-11-20 at 23 39 50 5148daf60e7" />

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 user profile update functionality, allowing users to update their email address (with OTP verification) and full name. The main features include a two-step email change flow with OTP verification, security measures like rate limiting, and a scheduled task to clean up expired OTPs.

  • Added email update endpoints with OTP verification flow
  • Added full name update endpoint
  • Added password length validation change from 128 to 72 characters
  • Added SQLite compatibility improvements to database migrations

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
routers/user.py Added email update and full name update endpoints with OTP verification logic
db/models.py Added EmailChangeOtp model and fixed Auth0Role flush instead of commit
schemas/biocommons.py Added BiocommonsEmail, BiocommonsFullName validators and OldEmailRecord model; updated password max length
scheduled_tasks/tasks.py Added cleanup_email_otps task and fixed Auth0Role.get_or_create_by_id null check
run_scheduler.py Added cleanup job scheduling and table creation logic
migrations/versions/9f2d8c1b5d4e_add_email_change_otps.py Created migration for email_change_otps table
migrations/versions/*.py Added SQLite compatibility using batch mode and inspector checks
tests/test_user.py Added tests for email and full name update flows
tests/test_router_user_utils.py Added tests for OTP utility functions
tests/test_cleanup_otps.py Added tests for OTP cleanup task
tests/schemas/test_biocommons_schemas.py Added email validation tests and updated password length tests
tests/schemas/test_group_schema.py Added Group schema validation tests
tests/test_sbp_register.py Fixed test data to use dynamic allowed domain

@marius-mather marius-mather changed the title Feature/profile endpoints feat: profile update endpoints (including email change with OTP) Nov 20, 2025
marius-mather
marius-mather previously approved these changes Nov 20, 2025
Copy link
Collaborator

@marius-mather marius-mather left a comment

Choose a reason for hiding this comment

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

all looks good to me!

@uwwint uwwint force-pushed the feature/profile_endpoints branch from 5eba435 to c06c06a Compare November 21, 2025 00:33
@uwwint uwwint requested a review from marius-mather November 21, 2025 00:35
Copy link
Collaborator

@marius-mather marius-mather left a comment

Choose a reason for hiding this comment

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

looks good to me

@uwwint uwwint merged commit 84f34ac into main Nov 21, 2025
4 checks passed
@amandazhuyilan amandazhuyilan deleted the feature/profile_endpoints branch November 24, 2025 22:22
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