Skip to content

Comments

hotfix/update social auth#389

Open
rf2tsl wants to merge 2 commits intomasterfrom
hotfix/update-social-auth
Open

hotfix/update social auth#389
rf2tsl wants to merge 2 commits intomasterfrom
hotfix/update-social-auth

Conversation

@rf2tsl
Copy link
Contributor

@rf2tsl rf2tsl commented Feb 19, 2026

update to social auth to work with Django 5.2 and to add jwt token to response

Summary by CodeRabbit

  • New Features

    • Authentication responses now include additional JWT token and refresh data when provided by the authentication backend.
  • Chores

    • Relaxed version constraint on the social authentication dependency to allow broader compatibility.
    • Removed inheritance of test-specific configuration from the social auth settings.

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Removed test-settings import from social-auth config, added conditional injection of JWT token and refresh into authentication responses when provided by the backend strategy, and relaxed the social-auth-core version pin in packaging metadata.

Changes

Cohort / File(s) Summary
JWT Token Response Enhancement
baseapp_social_auth/views.py
After assembling auth response data in do, conditionally add token and refresh fields when strategy exposes jwt_token / jwt_refresh. No control-flow changes beyond payload augmentation.
Configuration & Packaging
baseapp_social_auth/settings.py, setup.cfg
Removed baseapp_core.tests.settings import from social auth settings; loosened social-auth-core version constraint (was ==4.5.4, now unspecified).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop, a nibble, tokens in tow,
I tuck a JWT where responses go.
Test imports trimmed, constraints set free,
Social auth hums — a lighter spree. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'hotfix/update social auth' directly relates to the main changes in the pull request, which involve updating social authentication code for Django 5.2 compatibility and adding JWT token handling.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hotfix/update-social-auth

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
setup.cfg (1)

82-82: Specify at least a lower-bound version for social-auth-core.

The bare social-auth-core with no version specifier is unusual and obscures intent. The previous == 4.5.4 pin was also problematic — rest-social-auth (already in the same socialauth extras group) requires social-auth-core (>=4.6.1, <5.0), meaning the old == 4.5.4 pin was below that floor and could cause resolver conflicts. Setting a matching lower bound makes the requirement self-documenting and guards against accidental downgrade:

♻️ Proposed fix
-    social-auth-core 
+    social-auth-core >= 4.6.1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@setup.cfg` at line 82, Change the bare dependency entry "social-auth-core" to
include a compatible lower bound (and optional upper bound) to match
rest-social-auth's requirement; update the requirement to something like
"social-auth-core>=4.6.1,<5.0" (or at least "social-auth-core>=4.6.1") so the
package spec is explicit and avoids resolver conflicts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@baseapp_social_auth/views.py`:
- Around line 69-75: Remove trailing whitespace on the blank lines surrounding
the JWT pipeline block in baseapp_social_auth/views.py: delete the
whitespace-only characters on the blank lines before and after the "if
hasattr(request.backend.strategy, 'jwt_token'):" / "if
hasattr(request.backend.strategy, 'jwt_refresh'):" block so there are truly
empty lines (fixing flake8 W293) while leaving the existing logic that sets
data["token"] and data["refresh"] intact.

---

Nitpick comments:
In `@setup.cfg`:
- Line 82: Change the bare dependency entry "social-auth-core" to include a
compatible lower bound (and optional upper bound) to match rest-social-auth's
requirement; update the requirement to something like
"social-auth-core>=4.6.1,<5.0" (or at least "social-auth-core>=4.6.1") so the
package spec is explicit and avoids resolver conflicts.

@rf2tsl rf2tsl force-pushed the hotfix/update-social-auth branch from 7331b3b to a8f7169 Compare February 19, 2026 16:20
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