File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
packages/backend/src/tokens Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @clerk/backend ' : patch
3+ ---
4+
5+ Fixes an issue where a handshake would trigger more than intended in development.
Original file line number Diff line number Diff line change @@ -222,6 +222,7 @@ export class HandshakeService {
222222 const newUrl = new URL ( this . authenticateContext . clerkUrl ) ;
223223 newUrl . searchParams . delete ( constants . QueryParameters . Handshake ) ;
224224 newUrl . searchParams . delete ( constants . QueryParameters . HandshakeHelp ) ;
225+ newUrl . searchParams . delete ( constants . QueryParameters . DevBrowser ) ;
225226 headers . append ( constants . Headers . Location , newUrl . toString ( ) ) ;
226227 headers . set ( constants . Headers . CacheControl , 'no-store' ) ;
227228 }
@@ -323,7 +324,7 @@ ${developmentError.getFullMessage()}`,
323324
324325 const newCounterValue = this . authenticateContext . handshakeRedirectLoopCounter + 1 ;
325326 const cookieName = constants . Cookies . RedirectCount ;
326- headers . append ( 'Set-Cookie' , `${ cookieName } =${ newCounterValue } ; SameSite=Lax; HttpOnly; Max-Age=3 ` ) ;
327+ headers . append ( 'Set-Cookie' , `${ cookieName } =${ newCounterValue } ; SameSite=Lax; HttpOnly; Max-Age=2 ` ) ;
327328 return false ;
328329 }
329330
Original file line number Diff line number Diff line change @@ -386,7 +386,7 @@ export const authenticateRequest: AuthenticateRequest = (async (
386386 if ( ! mustActivate ) {
387387 return null ;
388388 }
389- if ( authenticateContext . handshakeRedirectLoopCounter > 0 ) {
389+ if ( authenticateContext . handshakeRedirectLoopCounter >= 3 ) {
390390 // We have an organization that needs to be activated, but this isn't our first time redirecting.
391391 // This is because we attempted to activate the organization previously, but the organization
392392 // must not have been valid (either not found, or not valid for this user), and gave us back
You can’t perform that action at this time.
0 commit comments