From 918ce406e014ba268219ad72b6f31127f6dba2ca Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Sun, 15 Mar 2026 05:16:12 +0300 Subject: [PATCH] feat: add Google OAuth sign-in button to login page Users can now sign in with their Google account via Supabase OAuth. Google button appears above wallet connect in the "Or continue with" section. --- web/src/pages/Login.tsx | 58 ++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/web/src/pages/Login.tsx b/web/src/pages/Login.tsx index 58436462..146ef101 100644 --- a/web/src/pages/Login.tsx +++ b/web/src/pages/Login.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '@/contexts/AuthContext'; import { usePezkuwi } from '@/contexts/PezkuwiContext'; +import { supabase } from '@/lib/supabase'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; @@ -121,6 +122,26 @@ const Login: React.FC = () => { } }; + const handleGoogleSignIn = async () => { + setError(''); + setLoading(true); + try { + const { error } = await supabase.auth.signInWithOAuth({ + provider: 'google', + options: { + redirectTo: window.location.origin + '/', + }, + }); + if (error) { + setError(error.message); + } + } catch { + setError('Google sign-in failed. Please try again.'); + } finally { + setLoading(false); + } + }; + return (
@@ -360,19 +381,32 @@ const Login: React.FC = () => {
- +
+ -

- {t('login.walletHint', 'Connect your Pezkuwi.js for instant access')} -

+ +