Fix trust center access creation in console
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user