Repository navigation
feat: update email availability check for profile updates and migrations - #311
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the authenticated profile email availability changes.
No open issues 🎉
What changed in this PR
Adds an authenticated profile email availability check for Auth0 and AAF users, allowing the frontend to detect conflicts before checking institutional eligibility.
Changes:
- Adds
GET /me/profile/email/check-availabilitywith a shared availability response schema. - Centralizes case-insensitive conflict checks across profile updates, OTP confirmation, and AAF migrations, including deleted accounts while excluding the current user.
- Expands tests for authentication, validation, and emails claimed after an earlier availability check or OTP request.
| File | Description |
|---|---|
tests/test_user.py |
Tests availability checks and conflict handling during email changes. |
tests/test_aaf.py |
Updates expected migration conflict messages. |
services/email_availability.py |
Introduces shared email availability and conflict checks. |
schemas/responses.py |
Defines the shared availability response schema. |
routers/utils.py |
Reuses the shared schema for registration availability checks. |
routers/user.py |
Adds the profile availability endpoint and adopts shared conflict checks. |
routers/aaf.py |
Reuses the shared conflict helper and aligns error messages. |
Review effort: Balanced
marius-mather
approved these changes
Nov 9, 2026
marius-mather
left a comment
Collaborator
There was a problem hiding this comment.
looks great! thanks for the refactor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add an authenticated profile email availability endpoint so the front end can check whether an email is already in use before checking institutional eligibility through AAF
Changes
Checklist