From b04ee4cb92b2b7c2863f0fa16fdd77523727f169 Mon Sep 17 00:00:00 2001 From: ewandor Date: Fri, 11 Apr 2025 22:15:56 +0200 Subject: [PATCH] UPdating oauth callbacks --- api/rpk-api/hub/auth/__init__.py | 2 +- gui/rpk-gui/src/providers/auth-provider.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/rpk-api/hub/auth/__init__.py b/api/rpk-api/hub/auth/__init__.py index 8d8fde6..ed51077 100644 --- a/api/rpk-api/hub/auth/__init__.py +++ b/api/rpk-api/hub/auth/__init__.py @@ -67,7 +67,7 @@ class AuthenticationBackendMe(AuthenticationBackend): class CookieTransportOauth(CookieTransport): async def get_login_response(self, token: str) -> Response: - response = RedirectResponse("/login?oauth=success", status_code=status.HTTP_301_MOVED_PERMANENTLY) + response = RedirectResponse("/auth/login?oauth=success", status_code=status.HTTP_301_MOVED_PERMANENTLY) return self._set_login_cookie(response, token) @staticmethod diff --git a/gui/rpk-gui/src/providers/auth-provider.tsx b/gui/rpk-gui/src/providers/auth-provider.tsx index 38ee3ba..77a7480 100644 --- a/gui/rpk-gui/src/providers/auth-provider.tsx +++ b/gui/rpk-gui/src/providers/auth-provider.tsx @@ -61,7 +61,10 @@ export const authProvider: AuthProvider = { const response = await fetch(`${API_URL}/hub/auth/logout`, { method: "POST" }); if (response.status == 204 || response.status == 401) { forget_user(); - return { success: true }; + return { + success: true, + redirectTo: "/", + }; } return { success: false }; },