Skip to content

50+ open-source generative AI apps you can clone, deploy, and monetize — image generators, video tools, virtual try-ons, AI SaaS templates, and platform integrations. One-click Vercel deploy on every template.

Restore: src/app/login/page.js

Anil Chandra Naidu Matcha0d40c75a25aa
diff --git a/src/app/login/page.js b/src/app/login/page.js
new file mode 100644
index 0000000..fc8732e
--- /dev/null
+++ b/src/app/login/page.js
@@ -0,0 +1,64 @@
+"use client";
+
+import { signIn, useSession } from "next-auth/react";
+import { useEffect, Suspense } from "react";
+import { useRouter, useSearchParams } from "next/navigation";
+import { FaGoogle, FaInfoCircle } from "react-icons/fa";
+
+function LoginContent() {
+ const { data: session, status } = useSession();
+ const router = useRouter();
+ const searchParams = useSearchParams();
+ const next = searchParams.get("callbackUrl") || searchParams.get("next") || "/";
+
+ useEffect(() => {
+ if (status === "authenticated") {
+ router.push(next);
+ }
+ }, [status, router, next]);
+
+ return (
+ <div className="min-h-dvh flex items-center justify-center bg-bg-page px-6 text-primary-text select-none">
+ <div className="relative bg-bg-card border border-divider w-full max-w-md rounded-lg p-8 space-y-8 shadow-2xl animate-scale-up">
+ <div className="flex flex-col items-center text-center space-y-4">
+ <div className="w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center text-2xl text-primary font-black shadow-md shadow-primary/15">
+ A
+ </div>
+ <h2 className="text-2xl font-black uppercase tracking-tight">Sign In to Studio</h2>
+ <p className="text-xs font-semibold text-secondary-text leading-relaxed px-4">
+ Sign in with Google to enable predictions, save generation history, and top up credits packages.
+ </p>
+ </div>
+
+ <div className="space-y-4">
+ <button
+ onClick={() => signIn("google", { callbackUrl: next })}
+ className="w-full py-3.5 bg-white text-neutral-900 rounded-full text-xs font-bold flex items-center justify-center gap-3 hover:opacity-90 transition-all shadow-md active:scale-[0.98] cursor-pointer"
+ >
+ <FaGoogle className="text-sm text-red-500" />
+ <span>Continue with Google</span>
+ </button>
+ </div>
+
+ <div className="flex items-start gap-2.5 bg-primary/5 border border-primary/10 p-3.5 rounded text-[11px] leading-relaxed text-secondary-text">
+ <FaInfoCircle className="text-primary text-xs shrink-0 mt-0.5" />
+ <span>
+ By signing in, you agree to our Terms of Service. Purchases are stripe-secured and credit balance addition is automated.
+ </span>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+export default function Login() {
+ return (
+ <Suspense fallback={
+ <div className="min-h-dvh flex items-center justify-center bg-bg-page text-primary-text">
+ <div className="w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin" />
+ </div>
+ }>
+ <LoginContent />
+ </Suspense>
+ );
+}