-
Notifications
You must be signed in to change notification settings - Fork 91
Description
As of now, when trying to specify your own OAuth provider, eg: DEX, it will not work due to the following error message.
NameError: cannot access free variable 'provider_config' where it is not associated with a value in enclosing scope. Did you mean: 'get_provider_config'?
Stack trace
`
INFO: 127.0.0.1:53600 - "GET /api/auth/providers HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.scope, self.receive, self.send
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\fastapi\applications.py", line 1139, in call
await super().call(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\applications.py", line 107, in call
await self.middleware_stack(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\middleware\errors.py", line 186, in call
raise exc
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in call
await self.app(scope, receive, _send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\middleware\sessions.py", line 85, in call
await self.app(scope, receive, send_wrapper)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\middleware\cors.py", line 85, in call
await self.app(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
raise exc
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\routing.py", line 716, in call
await self.middleware_stack(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\routing.py", line 736, in app
await route.handle(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette\routing.py", line 290, in handle
await self.app(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\fastapi\routing.py", line 119, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
raise exc
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\fastapi\routing.py", line 105, in app
response = await f(request)
^^^^^^^^^^^^^^^^
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\fastapi\routing.py", line 385, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "D:\GitHub\plombery-fork.venv\Lib\site-packages\fastapi\routing.py", line 284, in run_endpoint_function
return await dependant.call(**values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GitHub\plombery-fork\src\plombery\api\authentication.py", line 109, in get_providers
"name": provider_config.get("name"),
^^^^^^^^^^^^^^^
`