This is a Next.js project bootstrapped with
create-next-app.Getting Started
First, run the development server:
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying
app/page.js. The page auto-updates as you edit the file.This project uses
next/font to automatically optimize and load Geist, a new font family for Vercel.Learn More
To learn more about Next.js, take a look at the following resources:
Next.js Documentation - learn about Next.js features and API.
Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
Google Books API The API link
"use client"; import React, { useState } from "react"; import { auth, GoogleAuthProvider, GithubAuthProvider, signInWithEmailAndPassword, signInWithPopup, RecaptchaVerifier, PhoneAuthProvider, } from "../utils/firebase"; // Updated import import Link from "next/link"; // Import Link for navigation import { FaSignInAlt } from "react-icons/fa"; // Import login icon
const Login = () => { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [phone, setPhone] = useState(""); const [error, setError] = useState("");
// Email/Password Login const handleEmailLogin = async () => { try { await signInWithEmailAndPassword(auth, email, password); window.location.href = "/dashboard"; // Redirect to dashboard } catch (error) { setError(error.message); } };
// Google Login const handleGoogleLogin = async () => { const provider = new GoogleAuthProvider(); try { await signInWithPopup(auth, provider); window.location.href = "/dashboard"; // Redirect to dashboard } catch (error) { setError(error.message); } };
// GitHub Login const handleGithubLogin = async () => { const provider = new GithubAuthProvider(); try { await signInWithPopup(auth, provider); window.location.href = "/dashboard"; // Redirect to dashboard } catch (error) { setError(error.message); } };
// Phone Number Login const handlePhoneLogin = async () => { const recaptchaVerifier = new RecaptchaVerifier( "recaptcha-container", { size: "invisible", }, auth ); const phoneProvider = new PhoneAuthProvider(auth); try { const confirmationResult = await phoneProvider.verifyPhoneNumber( phone, recaptchaVerifier ); const code = prompt("Enter the OTP sent to your phone"); await confirmationResult.confirm(code); window.location.href = "/dashboard"; // Redirect to dashboard } catch (error) { setError(error.message); } };
return (
{/_ NavBar _/}
Bookstore
Login
); };
export default Login;
0 likes · 3 views · Oct 6, 2025
Developed a Next.js app with authentication features.