From 3a73a327c325304bc57167f0f009dac14c2ba54d Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Sat, 5 Jul 2025 21:44:45 +0200 Subject: [PATCH] Fix login with redirect --- .../BrandButtons/LoginWithGoogle.test.tsx | 4 +-- .../BrandButtons/LoginWithGoogle.tsx | 8 ++--- ui/src/components/PublicRoute.tsx | 9 +++++- ui/src/hooks/auth.ts | 29 +++++++------------ ui/src/pages/login.tsx | 16 ++++++---- ui/src/pages/oauth-signin.tsx | 6 ++-- ui/src/pages/signup.tsx | 11 +++---- 7 files changed, 41 insertions(+), 42 deletions(-) diff --git a/ui/src/components/BrandButtons/LoginWithGoogle.test.tsx b/ui/src/components/BrandButtons/LoginWithGoogle.test.tsx index 78dfd38..3174855 100644 --- a/ui/src/components/BrandButtons/LoginWithGoogle.test.tsx +++ b/ui/src/components/BrandButtons/LoginWithGoogle.test.tsx @@ -14,7 +14,7 @@ describe("LoginWithGoogle", () => { loginWithGoogle: mockLoginWithGoogle, }); - render(); + render(); const button = screen.getByRole("button", { name: /Continuer avec Google/i, @@ -28,7 +28,7 @@ describe("LoginWithGoogle", () => { loginWithGoogle: mockLoginWithGoogle, }); - render(); + render(); const button = screen.getByRole("button", { name: /Continuer avec Google/i, diff --git a/ui/src/components/BrandButtons/LoginWithGoogle.tsx b/ui/src/components/BrandButtons/LoginWithGoogle.tsx index 7417dee..0dedcd0 100644 --- a/ui/src/components/BrandButtons/LoginWithGoogle.tsx +++ b/ui/src/components/BrandButtons/LoginWithGoogle.tsx @@ -1,12 +1,8 @@ import "./login-with-google.css"; import { useLoginGoogle } from "../../hooks/auth"; -export function LoginWithGoogle({ - redirectUrl, -}: { - redirectUrl: string | null; -}) { - const { loginWithGoogle } = useLoginGoogle({ redirectUrl }); +export function LoginWithGoogle() { + const { loginWithGoogle } = useLoginGoogle(); return (