Skip to content

Commit 84e6c8d

Browse files
committed
Update project dependencies and custom connection handler
1 parent 5613697 commit 84e6c8d

File tree

5 files changed

+2850
-2467
lines changed

5 files changed

+2850
-2467
lines changed

llmstack/connections/handlers/custom_google_provider/urls.py

Whitespace-only changes.

llmstack/connections/urls.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
class CustomOAuth2LoginView(OAuth2LoginView):
3030
def login(self, request, *args, **kwargs):
3131
provider = self.adapter.get_provider()
32-
app = provider.get_app(self.request)
32+
app = provider.app
3333
client = self.get_client(request, app)
3434
action = request.GET.get("action", AuthAction.AUTHENTICATE)
3535
auth_url = self.adapter.authorize_url
@@ -61,6 +61,7 @@ def login(self, request, *args, **kwargs):
6161

6262
class CustomOAuth2CallbackView(OAuth2CallbackView):
6363
def dispatch(self, request, *args, **kwargs):
64+
provider = self.adapter.get_provider()
6465
if "error" in request.GET or "code" not in request.GET:
6566
# Distinguish cancel from error
6667
auth_error = request.GET.get("error", None)
@@ -70,7 +71,7 @@ def dispatch(self, request, *args, **kwargs):
7071
error = AuthError.UNKNOWN
7172
return render_authentication_error(
7273
request,
73-
self.adapter.provider_id,
74+
provider,
7475
error=error,
7576
)
7677
app = self.adapter.get_provider().get_app(self.request)
@@ -82,7 +83,8 @@ def dispatch(self, request, *args, **kwargs):
8283
client,
8384
)
8485
token = self.adapter.parse_token(access_token)
85-
token.app = app
86+
if app.pk:
87+
token.app = app
8688
result = self.adapter.complete_login(
8789
request,
8890
app,

llmstack/server/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"django.contrib.auth.middleware.AuthenticationMiddleware",
7979
"django.contrib.messages.middleware.MessageMiddleware",
8080
"django.middleware.clickjacking.XFrameOptionsMiddleware",
81+
"allauth.account.middleware.AccountMiddleware",
8182
"llmstack.apps.authorization_middleware.AuthorizationMiddleware",
8283
]
8384

0 commit comments

Comments
 (0)