middleware and respnse models updated
This commit is contained in:
@@ -92,11 +92,12 @@ class MiddlewareModule:
|
||||
auth_context = AuthContext(
|
||||
auth={"token": {"access_token": "", "refresher_token": "", "context": {}}},
|
||||
url=endpoint_url,
|
||||
request=request,
|
||||
)
|
||||
|
||||
# Set auth context on the wrapper function itself
|
||||
setattr(func, 'auth_context', auth_context)
|
||||
setattr(wrapper, 'auth_context', auth_context)
|
||||
setattr(func, "auth_context", auth_context)
|
||||
setattr(wrapper, "auth_context", auth_context)
|
||||
|
||||
# Call the original endpoint function
|
||||
if inspect.iscoroutinefunction(func):
|
||||
@@ -105,10 +106,11 @@ class MiddlewareModule:
|
||||
result = func(request, *args, **kwargs)
|
||||
|
||||
# Set auth context on the wrapper function itself
|
||||
setattr(func, 'auth_context', auth_context)
|
||||
setattr(wrapper, 'auth_context', auth_context)
|
||||
|
||||
setattr(func, "auth_context", auth_context)
|
||||
setattr(wrapper, "auth_context", auth_context)
|
||||
|
||||
return result
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user