Remove duplicate membership method

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-16 11:14:20 +04:00
parent 56ec0ab3c3
commit 7794563e94
6 changed files with 29 additions and 12 deletions

View File

@@ -366,7 +366,7 @@ func (s SessionService) OpenPasswordChildSessionForOrganization(
return NewUserInactiveError(profile.ID)
}
err = membership.LoadByIdentityInOrganization(ctx, tx, rootSession.IdentityID, organizationID)
err = membership.LoadByIdentityIDAndOrganizationID(ctx, tx, scope, rootSession.IdentityID, organizationID)
if err != nil {
if err == coredata.ErrResourceNotFound {
return NewMembershipNotFoundError(organizationID)
@@ -468,7 +468,7 @@ func (s SessionService) OpenSAMLChildSessionForOrganization(
return NewUserInactiveError(profile.ID)
}
err = membership.LoadByIdentityInOrganization(ctx, tx, rootSession.IdentityID, organizationID)
err = membership.LoadByIdentityIDAndOrganizationID(ctx, tx, scope, rootSession.IdentityID, organizationID)
if err != nil {
if err == coredata.ErrResourceNotFound {
return NewMembershipNotFoundError(organizationID)
@@ -554,7 +554,7 @@ func (s SessionService) AssumeOrganizationSession(
return NewUserInactiveError(profile.ID)
}
if err := membership.LoadByIdentityInOrganization(ctx, tx, rootSession.IdentityID, organizationID); err != nil {
if err := membership.LoadByIdentityIDAndOrganizationID(ctx, tx, scope, rootSession.IdentityID, organizationID); err != nil {
if err == coredata.ErrResourceNotFound {
return NewMembershipNotFoundError(organizationID)
}