Skip to content

feat(auth): surface is_new_user in OAuth login responses#8011

Open
Zaimwa9 wants to merge 3 commits into
mainfrom
feat/surface-is-new-user-on-oauth
Open

feat(auth): surface is_new_user in OAuth login responses#8011
Zaimwa9 wants to merge 3 commits into
mainfrom
feat/surface-is-new-user-on-oauth

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Google and GitHub OAuth login responses now include is_new_user, true when the login created the account. This lets the frontend distinguish OAuth signups from logins, so signup conversion events (see #7979) can also be emitted for OAuth-based signups. No model changes.

How did you test this code?

Unit tests: existing OAuth view tests extended to assert is_new_user is true for newly created users and false for existing ones.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jul 15, 2026 10:12am
flagsmith-frontend-preview Ignored Ignored Preview Jul 15, 2026 10:12am
flagsmith-frontend-staging Ignored Ignored Preview Jul 15, 2026 10:12am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 47f0c9bb-3919-4b53-9b87-a908fe394e67

📥 Commits

Reviewing files that changed from the base of the PR and between 1c7121d and 59fd851.

📒 Files selected for processing (4)
  • api/custom_auth/oauth/serializers.py
  • api/custom_auth/oauth/views.py
  • api/tests/unit/custom_auth/oauth/test_unit_oauth_views.py
  • openapi.yaml

📝 Walkthrough

Walkthrough

OAuth login now tracks whether authentication created a new user. Google and GitHub endpoints return the token key and is_new_user value when cookie authentication is disabled. OpenAPI definitions use the new read-only OAuthToken schema, and tests cover newly created and existing-user responses.

Estimated code review effort: 2 (Simple) | ~10 minutes


Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added api Issue related to the REST API feature New feature or request labels Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (1042aad) to head (59fd851).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8011   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files        1497     1497           
  Lines       59287    59295    +8     
=======================================
+ Hits        58481    58489    +8     
  Misses        806      806           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jul 15, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jul 15, 2026
@Zaimwa9 Zaimwa9 marked this pull request as ready for review July 15, 2026 15:48
@Zaimwa9 Zaimwa9 requested review from a team as code owners July 15, 2026 15:48
@Zaimwa9 Zaimwa9 requested review from gagantrivedi and khvn26 and removed request for a team and khvn26 July 15, 2026 15:48
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-8011 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-8011 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api-test:pr-8011 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8011 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-8011 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8011 Finished ✅ Results

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  19.6 seconds
commit  59fd851
info  🔄 Run: #18304 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  5 passed

Details

stats  5 tests across 4 suites
duration  50.6 seconds
commit  59fd851
info  🔄 Run: #18304 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  6 passed

Details

stats  6 tests across 5 suites
duration  37 seconds
commit  59fd851
info  🔄 Run: #18304 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  5 passed

Details

stats  5 tests across 4 suites
duration  48.8 seconds
commit  59fd851
info  🔄 Run: #18304 (attempt 1)

@github-actions

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants