Fix trust center access creation in console

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-16 14:22:42 +04:00
committed by Bryan Frimin
parent 6c7bcfb50a
commit 00eb3cde5e

View File

@@ -1676,19 +1676,16 @@ func (r *mutationResolver) CreateTrustCenterAccess(ctx context.Context, input ty
prb := r.ProboService(ctx, input.TrustCenterID.TenantID()) prb := r.ProboService(ctx, input.TrustCenterID.TenantID())
// TODO: should not create an access nor identity, but send an invitation // TODO: should not create an access nor identity, but send an invitation
identity := authn.IdentityFromContext(ctx) identity, err := r.iam.AuthService.LoadOrCreateIdentity(
if identity == nil { ctx,
var err error &iam.LoadOrCreateIdentityRequest{
identity, err = r.iam.AuthService.LoadOrCreateIdentity( Email: input.Email,
ctx, FullName: input.Name,
&iam.LoadOrCreateIdentityRequest{ },
Email: input.Email, )
}, if err != nil {
) r.logger.ErrorCtx(ctx, "cannot load or create identity", log.Error(err))
if err != nil { return nil, gqlutils.Internal(ctx)
r.logger.ErrorCtx(ctx, "cannot load or create identity", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
} }
access, err := prb.TrustCenterAccesses.Create( access, err := prb.TrustCenterAccesses.Create(