JWTRefreshTokenBundle icon indicating copy to clipboard operation
JWTRefreshTokenBundle copied to clipboard

object_manager not recognized

Open stijn-at-work opened this issue 5 years ago • 1 comments

unable to generate a refresh token with our second (non default) entity manager.

error: Unable to replace alias "gesdinet.jwtrefreshtoken.object_manager" with actual definition entity_manager_2".

config.yml

doctrine:
    orm:
        default_entity_manager: entity_manager_1
        entity_managers:
            entity_manager_1:
                connection: connection_1
                mappings:
                    ...
            entity_manager_2:
                connection: connection_2
                mappings:
                    ...

gesdinet_jwt_refresh_token:
    user_provider: my_user_provider
    object_manager: entity_manager_2

stijn-at-work avatar Jul 11 '19 09:07 stijn-at-work

I have the same problem. Here's ma ORM/doctrine configuration :

doctrine:
  dbal:
    default_connection: default_connection
    connections:
      default_connection:
        driver: '%database_driver%'
        host: '%database_host%'
        user: '%database_user%'
        password: '%database_password%'
        dbname: '%database_name%'
      custom_connection:
        driver: '%database_driver%'
        host: '%database_custom_host%'
        user: '%database_custom_user%'
        password: '%database_custom_password%'
        dbname: '%database_custom_name%'
  orm:
    auto_generate_proxy_classes: '%kernel.debug%'
    entity_managers:
      default:
        connection: default_connection
        mappings:
          SomeBundle: ~
      custom_em:
        connection: custom_connection
        mappings:
          OtherBundle: ~
          #GesdinetJWTRefreshTokenBundle: ~

I want that my table refresh_token need to be created in custom_em So i do :

gesdinet_jwt_refresh_token:
  object_manager: doctrine.orm.custom_em_entity_manager

It's the only way to haven't any errors but when i want ti launch : bin/console doctrine:schema:update --dump-sql --em="custom_em" nothing is find.

Astro-Otter-Space avatar Jun 11 '20 12:06 Astro-Otter-Space