From 5995f41fa0478df69e598cecc63e7b68ea69dc28 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 12 May 2026 06:55:09 +0000 Subject: [PATCH] Remove backend inactive profile validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users are created with state=INACTIVE and only become ACTIVE on first login. The server-side state check incorrectly rejected newly-created users who hadn't yet activated their accounts. The frontend filter (state: ACTIVE) is the correct layer to hide deactivated people from the recipient picker. The existing contract end date validation remains as server-side defense in depth. Co-authored-by: Émile Ré Signed-off-by: Émile Ré Signed-off-by: Émile Ré --- pkg/probo/document_service.go | 15 --------------- pkg/server/api/console/v1/document_resolvers.go | 8 -------- 2 files changed, 23 deletions(-) diff --git a/pkg/probo/document_service.go b/pkg/probo/document_service.go index 7de295e86..5e11cac51 100644 --- a/pkg/probo/document_service.go +++ b/pkg/probo/document_service.go @@ -97,10 +97,6 @@ type ( ProfileID gid.GID } - ErrProfileInactive struct { - ProfileID gid.GID - } - CreateDocumentRequest struct { OrganizationID gid.GID Title string @@ -282,10 +278,6 @@ func (e ErrProfileContractEnded) Error() string { return fmt.Sprintf("cannot use profile %q: contract has ended", e.ProfileID) } -func (e ErrProfileInactive) Error() string { - return fmt.Sprintf("cannot use profile %q: profile is inactive", e.ProfileID) -} - func (s *DocumentService) Get( ctx context.Context, documentID gid.GID, @@ -979,9 +971,6 @@ func (s *DocumentService) BulkRequestSignatures( now := time.Now() for _, p := range *profiles { - if p.State == coredata.ProfileStateInactive { - return &ErrProfileInactive{ProfileID: p.ID} - } if p.ContractEndDate != nil && p.ContractEndDate.Before(now) { return &ErrProfileContractEnded{ProfileID: p.ID} } @@ -1093,10 +1082,6 @@ func (s *DocumentService) RequestSignature( return fmt.Errorf("cannot load signatory profile: %w", err) } - if profile.State == coredata.ProfileStateInactive { - return &ErrProfileInactive{ProfileID: profile.ID} - } - if profile.ContractEndDate != nil && profile.ContractEndDate.Before(time.Now()) { return &ErrProfileContractEnded{ProfileID: profile.ID} } diff --git a/pkg/server/api/console/v1/document_resolvers.go b/pkg/server/api/console/v1/document_resolvers.go index e33bf6bba..467d3d3bf 100644 --- a/pkg/server/api/console/v1/document_resolvers.go +++ b/pkg/server/api/console/v1/document_resolvers.go @@ -1296,10 +1296,6 @@ func (r *mutationResolver) RequestSignature(ctx context.Context, input types.Req return nil, gqlutils.Conflict(ctx, errContractEnded) } - if errInactive, ok := errors.AsType[*probo.ErrProfileInactive](err); ok { - return nil, gqlutils.Conflict(ctx, errInactive) - } - r.logger.ErrorCtx(ctx, "cannot request signature", log.Error(err)) return nil, gqlutils.Internal(ctx) } @@ -1345,10 +1341,6 @@ func (r *mutationResolver) BulkRequestSignatures(ctx context.Context, input type return nil, gqlutils.Conflict(ctx, errContractEnded) } - if errInactive, ok := errors.AsType[*probo.ErrProfileInactive](err); ok { - return nil, gqlutils.Conflict(ctx, errInactive) - } - r.logger.ErrorCtx(ctx, "cannot bulk request signatures", log.Error(err)) return nil, gqlutils.Internal(ctx) }