Skip to content

Add BuiltinUI class #626

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

Open
wants to merge 3 commits into
base: auth
Choose a base branch
from
Open

Add BuiltinUI class #626

wants to merge 3 commits into from

Conversation

scotttrinh
Copy link

To use the built-in UI you must:

  1. Start a PKCE session
  2. Redirect to the built-in UI URL with the PKCE challenge

This class wraps up that functionality in a simple interface.
Implementations will need to save the verifier in a cookie, and redirect
the user agent to the BuiltinUIResponse.redirect_url, and then
exchange the PKCE code and verifier for a token using the normal PKCE
code exchange.

To use the built-in UI you must:

1. Start a PKCE session
2. Redirect to the built-in UI URL with the PKCE challenge

This class wraps up that functionality in a simple interface.
Implementations will need to save the verifier in a cookie, and redirect
the user agent to the `BuiltinUIResponse.redirect_url`, and then
exchange the PKCE code and verifier for a token using the normal PKCE
code exchange.
@scotttrinh scotttrinh requested review from fantix and Copilot May 30, 2025 20:23
Copy link

@Copilot 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 adds a BuiltinUI class to wrap up starting a PKCE-based sign-in and sign-up flow and refactors legacy authentication code.

  • Introduces BuiltinUI and AsyncBuiltinUI classes to manage PKCE generation and UI redirection.
  • Refactors BaseEmailPassword to derive from a new BaseClient in gel/auth/base.py, eliminating duplicate client initialization logic.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
gel/auth/email_password.py Refactored BaseEmailPassword to inherit from BaseClient, removing custom kwargs.
gel/auth/builtin_ui.py Added BuiltinUI and AsyncBuiltinUI to implement built-in UI sign-in and sign-up flows.
gel/auth/base.py Introduced BaseClient to centralize HTTP client initialization and related logic.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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