public function setupUser(Event $event, $user)
    {
        /** @var UsersGroupsTable $UsersGroups */
        $UsersGroups = TableRegistry::get('Wasabi/Core.UsersGroups');

        // setup the group ids for the given user
        $user['group_id'] = $UsersGroups->getGroupIds($user['id']);

        $user['password_hashed'] = $UsersGroups->Users->get($user['id'], ['fields' => ['password']])->get('password');
        return $user;
    }