- 
                Notifications
    
You must be signed in to change notification settings  - Fork 402
 
refactor(backend): Introduce HandshakeService #5754
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
| 
           The latest updates on your projects. Learn more about Vercel for Git ↗︎ 
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This feature introduces handshake nonce support in the backend authentication flow by refactoring handshake logic into a dedicated HandshakeService.
- Refactored inline handshake logic in request.ts to delegate handshake resolution and redirection handling to HandshakeService.
 - Extracted helper methods for building handshake redirects and detecting infinite redirection loops into HandshakeService.
 - Introduced a placeholder for handshake nonce handling in the new service.
 
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description | 
|---|---|
| packages/backend/src/tokens/request.ts | Updated to use HandshakeService methods for handshake resolution and redirect loop checks. | 
| packages/backend/src/tokens/handshake.ts | Introduced HandshakeService with consolidated handshake logic, organization sync support, and a new (placeholder) handshake nonce code path. | 
| } | ||
| 
               | 
          ||
| setHandshakeInfiniteRedirectionLoopHeaders(headers: Headers): boolean { | ||
| if (this.handshakeRedirectLoopCounter === 3) { | 
    
      
    
      Copilot
AI
    
    
    
      Apr 29, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The handshakeRedirectLoopCounter is not updated after computing newCounterValue; consider assigning newCounterValue back to this.handshakeRedirectLoopCounter to properly track the number of redirect loops.
          
 | 
    
Description
Refactoring Handshake related code to HandShake service
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change