From 7d451e8bba59c98034f343a0e1fd2ab84cbcb152 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Mon, 10 Nov 2025 19:28:07 +0000 Subject: [PATCH] Add redirectTo parameter to signInWithOAuth for staff login support cgen-a5840c22e224448a971db83eb1de3b17 --- client/contexts/AuthContext.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index 925ccee9..03ab3d68 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -641,8 +641,16 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ } }; - const signInWithOAuth = async (provider: SupportedOAuthProvider) => { + const signInWithOAuth = async ( + provider: SupportedOAuthProvider, + redirectTo?: string, + ) => { try { + // Store the intended redirect destination for after OAuth completes + if (redirectTo) { + sessionStorage.setItem("oauth_redirect_to", redirectTo); + } + const { data, error } = await supabase.auth.signInWithOAuth({ provider, options: {