File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -585,29 +585,13 @@ RestWrite.prototype.handleAuthData = async function (authData) {
585585
586586 // No user found with provided authData we need to validate
587587 if ( ! results . length ) {
588- // Capture the original authData before validation mutates the adapter's view,
589- // so that the optimistic lock below can detect single-use token consumption.
590- const originalAuthData = currentUserAuthData
591- ? Object . fromEntries (
592- Object . entries ( currentUserAuthData ) . map ( ( [ k , v ] ) =>
593- [ k , v && typeof v === 'object' ? { ...v } : v ]
594- )
595- )
596- : undefined ;
597588 const { authData : validatedAuthData , authDataResponse } = await Auth . handleAuthDataValidation (
598589 authData ,
599590 this
600591 ) ;
601592 this . authDataResponse = authDataResponse ;
602593 // Replace current authData by the new validated one
603594 this . data . authData = validatedAuthData ;
604- // For UPDATE paths (e.g. PUT /users/:id during MFA SMS enrollment confirmation),
605- // extend the update WHERE clause so concurrent single-use token consumers cannot
606- // both succeed; the no-user branch is reached because findUsersWithAuthData has
607- // no way to key on provider fields like the MFA pending token.
608- if ( this . query && this . query . objectId && Object . keys ( this . data . authData ) . length ) {
609- applyAuthDataOptimisticLock ( this . query , originalAuthData , this . data . authData ) ;
610- }
611595 return ;
612596 }
613597
You can’t perform that action at this time.
0 commit comments