44
55from ellar .common import IModuleSetup , Module
66from ellar .core import Config , ModuleSetup
7- from ellar .core .modules import DynamicModule , ModuleBase
7+ from ellar .core .modules import DynamicModule , ModuleBase , ModuleRefBase
88from ellar .di import ProviderConfig
99from pydantic import AnyHttpUrl
1010
1111from .schemas import JWTConfiguration
1212from .services import JWTService
1313
1414
15- @Module ()
15+ @Module (exports = [ JWTService , JWTConfiguration ] )
1616class JWTModule (ModuleBase , IModuleSetup ):
1717 @classmethod
1818 def setup (
@@ -43,7 +43,7 @@ def setup(
4343 return DynamicModule (
4444 cls ,
4545 providers = [
46- JWTService ,
46+ ProviderConfig ( JWTService ) ,
4747 ProviderConfig (JWTConfiguration , use_value = configuration ),
4848 ],
4949 )
@@ -54,14 +54,14 @@ def register_setup(cls) -> ModuleSetup:
5454
5555 @staticmethod
5656 def register_setup_factory (
57- module : t . Type [ "JWTModule" ] , config : Config
57+ module_ref : ModuleRefBase , config : Config
5858 ) -> DynamicModule :
5959 if config .get ("JWT_CONFIG" ) and isinstance (config .JWT_CONFIG , dict ):
6060 schema = JWTConfiguration (** dict (config .JWT_CONFIG ))
6161 return DynamicModule (
62- module ,
62+ module_ref . module ,
6363 providers = [
64- JWTService ,
64+ ProviderConfig ( JWTService ) ,
6565 ProviderConfig (JWTConfiguration , use_value = schema ),
6666 ],
6767 )
0 commit comments