-
+
+
This is your dashboard where you can manage your projects, view
contributions, and access all the features of the platform. The
authentication system is now working properly!
diff --git a/app/providers.tsx b/app/providers.tsx
index 848d2638e..bd629961c 100644
--- a/app/providers.tsx
+++ b/app/providers.tsx
@@ -5,14 +5,6 @@ import { AuthProvider } from '@/components/providers/auth-provider';
import { WalletProvider } from '@/components/providers/wallet-provider';
import { TrustlessWorkProvider } from '@/lib/providers/TrustlessWorkProvider';
import { EscrowProvider } from '@/lib/providers/EscrowProvider';
-import { NotificationProvider } from 'react-notification-core';
-import {
- mockFetchNotifications,
- mockMarkAsRead,
- mockMarkAllAsRead,
- mockDeleteNotification,
-} from '@/lib/mock';
-
interface ProvidersProps {
children: ReactNode;
}
@@ -22,21 +14,7 @@ export function Providers({ children }: ProvidersProps) {
-
-
- {children}
-
-
+ {children}
diff --git a/components/auth/GoogleOneTap.tsx b/components/auth/GoogleOneTap.tsx
new file mode 100644
index 000000000..1b9e9093b
--- /dev/null
+++ b/components/auth/GoogleOneTap.tsx
@@ -0,0 +1,59 @@
+'use client';
+
+import { useEffect, useRef } from 'react';
+import { useAuthStatus } from '@/hooks/use-auth';
+import { authClient } from '@/lib/auth-client';
+
+export function GoogleOneTap() {
+ const { isAuthenticated, isLoading } = useAuthStatus();
+ const hasTriggeredRef = useRef(false);
+
+ useEffect(() => {
+ // Don't trigger if user is authenticated or still loading
+ if (isAuthenticated || isLoading) {
+ return;
+ }
+
+ // Only trigger once per component mount
+ if (hasTriggeredRef.current) {
+ return;
+ }
+
+ // Small delay to ensure page is fully loaded
+ const timer = setTimeout(() => {
+ hasTriggeredRef.current = true;
+
+ // Call One Tap to show the popup
+ authClient
+ .oneTap({
+ callbackURL: window.location.href,
+ fetchOptions: {
+ onSuccess: () => {
+ // On success, reload the page to reflect auth state
+ // Better Auth will handle the redirect via callbackURL
+ window.location.reload();
+ },
+ onError: () => {
+ // Silently handle errors - user may have dismissed the prompt
+ },
+ },
+ onPromptNotification: () => {
+ // Called when max attempts are reached
+ // User has dismissed/skipped the prompt multiple times
+ // You could show an alternative sign-in button here if needed
+ },
+ })
+ .catch(() => {
+ // Silently handle errors in calling oneTap
+ });
+ }, 1000); // 1 second delay for better UX
+
+ return () => {
+ clearTimeout(timer);
+ };
+ }, [isAuthenticated, isLoading]);
+
+ // This component doesn't render anything visible
+ // Google One Tap handles its own UI in the top-right corner
+ return null;
+}
diff --git a/components/auth/LoginForm.tsx b/components/auth/LoginForm.tsx
index 0028afbe8..3f5f6bfb3 100644
--- a/components/auth/LoginForm.tsx
+++ b/components/auth/LoginForm.tsx
@@ -1,10 +1,11 @@
'use client';
import { Eye, EyeOff, LockIcon, MailIcon } from 'lucide-react';
-// import Image from 'next/image';
+import Image from 'next/image';
import Link from 'next/link';
import { UseFormReturn } from 'react-hook-form';
import z from 'zod';
import { BoundlessButton } from '../buttons';
+import { Badge } from '../ui/badge';
import { Checkbox } from '../ui/checkbox';
import {
Form,
@@ -32,6 +33,8 @@ interface LoginFormProps {
showPassword: boolean;
setShowPassword: (show: boolean) => void;
isLoading: boolean;
+ onGoogleSignIn?: () => void;
+ lastMethod?: string | null;
}
const LoginForm = ({
@@ -40,7 +43,11 @@ const LoginForm = ({
showPassword,
setShowPassword,
isLoading,
+ onGoogleSignIn,
+ lastMethod,
}: LoginFormProps) => {
+ const isGoogleLastUsed = lastMethod === 'google';
+ const isEmailLastUsed = lastMethod === 'email';
return (
<>
@@ -50,30 +57,48 @@ const LoginForm = ({
- {/*
- }
- className='bg-background hover:!text-background border !border-[#484848] text-base !text-white'
- >
- Continue with Google
- */}
- {/*
+
+
+ }
+ className={`group bg-background hover:!text-background flex items-center justify-center gap-2 text-base !text-white transition-all duration-200 ${
+ isGoogleLastUsed
+ ? 'border-2 !border-[#a7f950] shadow-sm shadow-[#a7f950]/20'
+ : 'border !border-[#484848]'
+ }`}
+ onClick={onGoogleSignIn}
+ disabled={isLoading}
+ >
+
+ Continue with Google
+ {isGoogleLastUsed && (
+
+ Last used
+
+ )}
+
+
+
*/}
+