UPdating oauth callbacks

This commit is contained in:
2025-04-11 22:15:56 +02:00
parent 4e613554e6
commit b04ee4cb92
2 changed files with 5 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ class AuthenticationBackendMe(AuthenticationBackend):
class CookieTransportOauth(CookieTransport): class CookieTransportOauth(CookieTransport):
async def get_login_response(self, token: str) -> Response: 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) return self._set_login_cookie(response, token)
@staticmethod @staticmethod

View File

@@ -61,7 +61,10 @@ export const authProvider: AuthProvider = {
const response = await fetch(`${API_URL}/hub/auth/logout`, { method: "POST" }); const response = await fetch(`${API_URL}/hub/auth/logout`, { method: "POST" });
if (response.status == 204 || response.status == 401) { if (response.status == 204 || response.status == 401) {
forget_user(); forget_user();
return { success: true }; return {
success: true,
redirectTo: "/",
};
} }
return { success: false }; return { success: false };
}, },