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

add logic for github auth #1796

Merged
merged 1 commit into from
Jan 10, 2025
Merged

add logic for github auth #1796

merged 1 commit into from
Jan 10, 2025

Conversation

emrgnt-cmplxty
Copy link
Contributor

@emrgnt-cmplxty emrgnt-cmplxty commented Jan 10, 2025

Important

Adds GitHub OAuth logic to oauth_callback_handler in r2r_auth.py, handling user creation and linking by email and GitHub ID.

  • Behavior:
    • Adds GitHub OAuth logic in oauth_callback_handler in r2r_auth.py.
    • Checks if user exists by email and GitHub ID; raises exception if user exists but is not linked to GitHub.
    • Creates new user with account_type='oauth' and github_id if not found.
  • Misc:
    • Changes account_type from google to oauth for Google users.

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

@emrgnt-cmplxty emrgnt-cmplxty marked this pull request as ready for review January 10, 2025 01:19
@emrgnt-cmplxty emrgnt-cmplxty merged commit 4a77ebf into main Jan 10, 2025
3 checks passed
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.

❌ Changes requested. Reviewed everything up to 810a6f3 in 59 seconds

More details
  • Looked at 41 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. py/core/providers/auth/r2r_auth.py:585
  • Draft comment:
    The comment mentions user.google_id in the GitHub section. It should be user.github_id.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_lhRhmtiwXTo1f4I6


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

status_code=401,
message="User already exists and is not linked to Github account",
)
except:
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using bare except: as it catches all exceptions, including system-exiting ones. Use except Exception: instead.

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.

1 participant