Skip to content

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

Merged
Zaimwa9 merged 4 commits into
mainfrom
feat/surface-is-new-user-on-oauth
Jul 16, 2026
Merged

feat(auth): surface is_new_user in OAuth login responses#8011
Zaimwa9 merged 4 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 16, 2026 8:03am
flagsmith-frontend-preview Ignored Ignored Preview Jul 16, 2026 8:03am
flagsmith-frontend-staging Ignored Ignored Preview Jul 16, 2026 8:03am

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: 583b9b70-9a1b-4464-873f-4e94c5df673b

📥 Commits

Reviewing files that changed from the base of the PR and between 59fd851 and 9ee3a7a.

📒 Files selected for processing (1)
  • api/custom_auth/oauth/views.py

📝 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 (9ee3a7a).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #8011    +/-   ##
========================================
  Coverage   98.64%   98.64%            
========================================
  Files        1497     1501     +4     
  Lines       59287    59474   +187     
========================================
+ Hits        58481    58668   +187     
  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)

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

passed  5 passed

Details

stats  5 tests across 4 suites
duration  43.2 seconds
commit  9ee3a7a
info  🔄 Run: #18339 (attempt 1)

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

passed  5 passed

Details

stats  5 tests across 4 suites
duration  19.5 seconds
commit  9ee3a7a
info  🔄 Run: #18339 (attempt 1)

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

passed  7 passed

Details

stats  7 tests across 5 suites
duration  42 seconds
commit  9ee3a7a
info  🔄 Run: #18339 (attempt 1)

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

passed  6 passed

Details

stats  6 tests across 5 suites
duration  12.4 seconds
commit  9ee3a7a
info  🔄 Run: #18339 (attempt 1)

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

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

Comment thread api/custom_auth/oauth/views.py Outdated
gagantrivedi
gagantrivedi previously approved these changes Jul 16, 2026
@github-actions github-actions Bot removed the feature New feature or request label Jul 16, 2026
@github-actions github-actions Bot added the feature New feature or request label Jul 16, 2026
@Zaimwa9
Zaimwa9 requested a review from gagantrivedi July 16, 2026 08:16
@Zaimwa9
Zaimwa9 merged commit 2c000a2 into main Jul 16, 2026
33 checks passed
@Zaimwa9
Zaimwa9 deleted the feat/surface-is-new-user-on-oauth branch July 16, 2026 08:25
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