-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix: Update security context via reactive context repository instead of directly updating session attributes #40892
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
Conversation
…of directly updating session attributes
WalkthroughThe change updates the email verification process in the user service implementation. It replaces direct session attribute manipulation with a reactive approach using a security context repository to save authentication context, chaining user and security context saves before redirecting. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UserServiceCEImpl
participant SecurityContextRepository
participant UserRepository
participant WebSession
User->>UserServiceCEImpl: Submit email verification token
UserServiceCEImpl->>UserRepository: Validate token & user
UserServiceCEImpl->>UserRepository: Set email as verified
UserServiceCEImpl->>SecurityContextRepository: Save security context in session
SecurityContextRepository->>WebSession: Store context
UserServiceCEImpl->>UserRepository: Save updated user
UserServiceCEImpl->>User: Redirect to target page
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (4)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Description
This PR fixes the security context persistence mechanism in the email verification flow. Previously, the code was directly manipulating the session attributes to store the security context, which is not the recommended approach in Spring WebFlux applications. We've updated the implementation to use the proper ServerSecurityContextRepository for persisting the security context.
Changes
Existing implementation:
Drawbacks:
Updated implementation:
Advantages:
Ref thread: https://theappsmith.slack.com/archives/C02K2MZERSL/p1749434009167839
/test Authentication,Email
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15532462184
Commit: 4244587
Cypress dashboard.
Tags:
@tag.Authentication, @tag.Email
Spec:
Mon, 09 Jun 2025 10:49:28 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit