mirror of https://github.com/h44z/wg-portal.git
				
				
				
			never publish pointer payloads on message bus (#411)
This commit is contained in:
		
							parent
							
								
									e2966d32ea
								
							
						
					
					
						commit
						059234d416
					
				|  | @ -82,7 +82,7 @@ func (m Manager) RegisterUser(ctx context.Context, user *domain.User) error { | |||
| 		return err | ||||
| 	} | ||||
| 
 | ||||
| 	m.bus.Publish(app.TopicUserRegistered, createdUser) | ||||
| 	m.bus.Publish(app.TopicUserRegistered, *createdUser) | ||||
| 
 | ||||
| 	return nil | ||||
| } | ||||
|  | @ -294,8 +294,8 @@ func (m Manager) ActivateApi(ctx context.Context, id domain.UserIdentifier) (*do | |||
| 		return nil, fmt.Errorf("update failure: %w", err) | ||||
| 	} | ||||
| 
 | ||||
| 	m.bus.Publish(app.TopicUserUpdated, user) | ||||
| 	m.bus.Publish(app.TopicUserApiEnabled, user) | ||||
| 	m.bus.Publish(app.TopicUserUpdated, *user) | ||||
| 	m.bus.Publish(app.TopicUserApiEnabled, *user) | ||||
| 
 | ||||
| 	return user, nil | ||||
| } | ||||
|  | @ -322,8 +322,8 @@ func (m Manager) DeactivateApi(ctx context.Context, id domain.UserIdentifier) (* | |||
| 		return nil, fmt.Errorf("update failure: %w", err) | ||||
| 	} | ||||
| 
 | ||||
| 	m.bus.Publish(app.TopicUserUpdated, user) | ||||
| 	m.bus.Publish(app.TopicUserApiDisabled, user) | ||||
| 	m.bus.Publish(app.TopicUserUpdated, *user) | ||||
| 	m.bus.Publish(app.TopicUserApiDisabled, *user) | ||||
| 
 | ||||
| 	return user, nil | ||||
| } | ||||
|  |  | |||
|  | @ -112,7 +112,7 @@ func (m Manager) connectToMessageBus() { | |||
| 	_ = m.bus.Subscribe(app.TopicUserDeleted, m.handleUserDeletedEvent) | ||||
| } | ||||
| 
 | ||||
| func (m Manager) handleUserCreationEvent(user *domain.User) { | ||||
| func (m Manager) handleUserCreationEvent(user domain.User) { | ||||
| 	if !m.cfg.Core.CreateDefaultPeerOnCreation { | ||||
| 		return | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue