diff --git a/src/contexts/AuthContext.tsx b/src/contexts/AuthContext.tsx index 834db4d..5464709 100644 --- a/src/contexts/AuthContext.tsx +++ b/src/contexts/AuthContext.tsx @@ -4,8 +4,6 @@ import { supabase } from '@/integrations/supabase/client'; import { Session, User } from '@supabase/supabase-js'; import { useToast } from '@/hooks/use-toast'; -type Provider = 'github' | 'google' | 'microsoft'; - type AuthContextType = { session: Session | null; user: User | null; @@ -14,7 +12,6 @@ type AuthContextType = { signIn: (email: string, password: string) => Promise; signUp: (email: string, password: string, fullName: string) => Promise; signOut: () => Promise; - signInWithProvider: (provider: Provider) => Promise; }; const AuthContext = createContext(undefined); @@ -131,33 +128,6 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => { } }; - const signInWithProvider = async (provider: Provider) => { - try { - setLoading(true); - const { error } = await supabase.auth.signInWithOAuth({ - provider, - options: { - redirectTo: window.location.origin + '/dashboard', - }, - }); - - if (error) throw error; - - toast({ - title: "Redirecting...", - description: `Signing in with ${provider}`, - }); - } catch (error: any) { - toast({ - title: `Error signing in with ${provider}`, - description: error.message, - variant: "destructive", - }); - console.error(`Error signing in with ${provider}:`, error); - setLoading(false); - } - }; - const signOut = async () => { try { setLoading(true); @@ -189,7 +159,6 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => { signIn, signUp, signOut, - signInWithProvider, }} > {children} diff --git a/src/pages/Auth.tsx b/src/pages/Auth.tsx index e383bbb..a06961a 100644 --- a/src/pages/Auth.tsx +++ b/src/pages/Auth.tsx @@ -8,10 +8,9 @@ import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; -import { Separator } from '@/components/ui/separator'; const Auth = () => { - const { user, signIn, signUp, signInWithProvider, loading } = useAuth(); + const { user, signIn, signUp, loading } = useAuth(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [fullName, setFullName] = useState(''); @@ -42,11 +41,6 @@ const Auth = () => { } }; - const handleSocialSignIn = (provider: 'github' | 'google' | 'microsoft') => { - setAuthError(null); - signInWithProvider(provider); - }; - return (
@@ -107,7 +101,7 @@ const Auth = () => {
{authError}
)} - + - -
-
- -
-
- - OR CONTINUE WITH - -
-
- -
- - - -
@@ -220,7 +173,7 @@ const Auth = () => {
{authError}
)} - + - -
-
- -
-
- - OR CONTINUE WITH - -
-
- -
- - - -