File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
backend/src/ee/services/pam-account Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -668,11 +668,6 @@ export const pamAccountServiceFactory = ({
668668 throw new BadRequestError ( { message : "Session has ended or expired" } ) ;
669669 }
670670
671- // Verify that the session has not already had credentials fetched
672- if ( session . status !== PamSessionStatus . Starting ) {
673- throw new BadRequestError ( { message : "Session has already been started" } ) ;
674- }
675-
676671 const account = await pamAccountDAL . findById ( session . accountId ) ;
677672 if ( ! account ) throw new NotFoundError ( { message : `Account with ID '${ session . accountId } ' not found` } ) ;
678673
@@ -690,10 +685,12 @@ export const pamAccountServiceFactory = ({
690685 const decryptedResource = await decryptResource ( resource , session . projectId , kmsService ) ;
691686
692687 // Mark session as started
693- await pamSessionDAL . updateById ( sessionId , {
694- status : PamSessionStatus . Active ,
695- startedAt : new Date ( )
696- } ) ;
688+ if ( session . status === PamSessionStatus . Starting ) {
689+ await pamSessionDAL . updateById ( sessionId , {
690+ status : PamSessionStatus . Active ,
691+ startedAt : new Date ( )
692+ } ) ;
693+ }
697694
698695 return {
699696 credentials : {
You can’t perform that action at this time.
0 commit comments