-
Notifications
You must be signed in to change notification settings - Fork 2
feat(UI-1841): enhance login security with OAuth improvements and token encryption #1309
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
RonenMars
wants to merge
25
commits into
main
Choose a base branch
from
ronen/refactor/login-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86eb47e
to
0f2439e
Compare
This reverts commit ed3cd2f.
- Remove all console.log statements from OAuth login flow - Add .serena/ to .gitignore for AI IDE configuration - Replace console statements with LoggerService calls using consoleOnly flag - Add OAuth error message translation for user-friendly error handling - Add toast notifications for OAuth login errors - Update 404 pages to use structured logging - Clean up debug console statements in chatbot iframe components
- Add validateOAuthRedirectURL utility function with domain allowlist - Enforce HTTPS requirement for all OAuth redirect URLs - Validate OAuth provider domains against security allowlist - Integrate URL validation into login component OAuth flow - Add comprehensive logging for security validation events Security improvements: - Prevent open redirect vulnerabilities - Restrict OAuth flows to trusted provider domains - Add runtime validation with detailed error logging
- Added proper OAuthResponse interface for OAuth callback handling - Fixed LoggerService calls to use correct parameter format - Updated TypeScript types for better type safety - Removed invalid Toast.title property usage
- Added exponential backoff retry logic for OAuth start failures - Configurable retry attempts (3) and base delay (1000ms) - Comprehensive error logging with structured messages - Proper error handling with user-friendly toast notifications
- Created oauthConfig with allowed domains and protocol constants - Improved code maintainability and configuration management - Consistent camelCase naming convention for better TypeScript compliance - Centralized OAuth security configuration
- Implement AES-GCM encryption for sensitive localStorage data using Web Crypto API - Replace clear text storage of API tokens with encrypted storage - Update localStorage utilities to support async encryption/decryption - Add request interceptors to dynamically decrypt tokens for authentication - Update affected components to handle async token operations - Maintain backward compatibility with fallback mechanisms Resolves CodeQL security warning for clear text storage of sensitive information.
dd6dc7e
to
e2bbe43
Compare
…rror 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Overview
Complete refactor of the OAuth authentication system with comprehensive security improvements, error handling, and code quality enhancements.
🚀 Key Features
Security Enhancements
consoleOnly: true
flagany
types with proper TypeScript interfacesError Handling & Resilience
Code Quality Improvements
oauthConfig
,oauthRetryConfig
)🛡️ Security Features
OAuth Redirect Validation
Error Boundary Protection
🔄 Retry Mechanism
Impact: This refactor significantly improves the security, reliability, and maintainability of the OAuth authentication system while maintaining backward compatibility.
Linear Ticket
https://linear.app/autokitteh/issue/UI-1841/reduce-login-screen-flash-after-successful-authentication
What type of PR is this? (check all applicable)