Skip to content
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

User Registration with Profile Fields #1790

Merged

Conversation

logerzerox
Copy link
Contributor

@logerzerox logerzerox commented Jan 9, 2025

🎯 Problem
Previously, setting user profile fields (name, bio, profile_picture) required two API calls:

Register user with email/password
Update user to add profile fields
This caused verification emails to use email prefix instead of actual name since the name was set after registration.

💡 Solution
Combined registration and profile update into a single API call by:

Adding profile fields to initial user registration
Removing the separate update call after registration
Ensuring verification emails use actual name immediately


Important

Combine user registration and profile update into a single API call, adding name, bio, and profile_picture fields to the registration process.

  • Behavior:
    • Combine user registration and profile update into a single API call in users_router.py.
    • Add name, bio, and profile_picture fields to register() in auth_service.py and r2r_auth.py.
    • Remove separate update call after registration in users_router.py.
    • Ensure verification emails use actual name immediately.
  • Database:
    • Update create_user() in users.py to include name, bio, and profile_picture fields.
    • Modify register() in supabase.py to accept new fields.
  • Misc:
    • Update register() in auth_service.py to pass new fields to providers.auth.register().
    • Adjust register() in r2r_auth.py to handle new fields.

This description was created by Ellipsis for d39fac2. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot 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! Reviewed everything up to d39fac2 in 2 minutes and 20 seconds

More details
  • Looked at 148 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. py/core/database/users.py:257
  • Draft comment:
    Ensure that the database schema allows null values for name, bio, and profile_picture or handle cases where these fields might be None to prevent potential database errors.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. py/core/main/api/v3/users_router.py:155
  • Draft comment:
    Consider adding validation for name, bio, and profile_picture fields to ensure they meet any necessary requirements (e.g., length, format) before proceeding with user registration.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment is suggesting adding validation, but:
  1. The fields are optional (marked as None by default)
  2. There's no clear evidence that validation is needed
  3. The validation would be a speculative addition without clear requirements
  4. If validation was needed, it would likely be handled in the auth service layer, not here
  5. The comment is not pointing out a specific issue, just suggesting a "nice to have"
    I could be wrong if there are business requirements for these fields that I'm not aware of. Maybe there are length limits or format requirements that should be enforced.
    Even if validation is needed, it should be specified in requirements first and then implemented in the service layer, not added speculatively at the API layer. The comment doesn't point to any specific validation rules that are missing.
    Delete the comment. It's a speculative suggestion without clear requirements or evidence of an actual issue.
3. py/core/main/services/auth_service.py:52
  • Draft comment:
    Consider adding validation for name, bio, and profile_picture fields to ensure they meet any necessary requirements (e.g., length, format) before proceeding with user registration.
  • Reason this comment was not posted:
    Marked as duplicate.
4. py/core/providers/auth/r2r_auth.py:237
  • Draft comment:
    Consider adding validation for name, bio, and profile_picture fields to ensure they meet any necessary requirements (e.g., length, format) before proceeding with user registration.
  • Reason this comment was not posted:
    Marked as duplicate.
5. py/core/providers/auth/supabase.py:82
  • Draft comment:
    Consider adding validation for name, bio, and profile_picture fields to ensure they meet any necessary requirements (e.g., length, format) before proceeding with user registration.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_9M8URbzjqYNUrw0Y


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@logerzerox logerzerox changed the title +create user with other fields User Registration with Profile Fields Jan 9, 2025
@NolanTrem NolanTrem merged commit a60d3b2 into SciPhi-AI:main Jan 10, 2025
1 of 2 checks passed
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.

2 participants