diff --git a/src/Components/Firebase/Firebase.js b/src/Components/Firebase/Firebase.js index b2073697..0d4f939c 100644 --- a/src/Components/Firebase/Firebase.js +++ b/src/Components/Firebase/Firebase.js @@ -23,11 +23,11 @@ const firebaseConfig = { const firebaseApp = initializeApp(firebaseConfig); const analytics = getAnalytics(firebaseApp); const db = getFirestore(firebaseApp); -const auth = getAuth(firebaseApp); const googleProvider = new GoogleAuthProvider(); +const githubProvider = new GithubAuthProvider(); const app = initializeApp(firebaseConfig); -const provider = new GoogleAuthProvider(); +const auth= getAuth(app); -export { auth, provider, signInWithPopup, googleProvider, GithubAuthProvider }; +export { auth, signInWithPopup, githubProvider, googleProvider, GithubAuthProvider }; export { db, analytics, app }; export default app; \ No newline at end of file diff --git a/src/Components/Login.css b/src/Components/Login.css index 0d849181..8acec7fe 100644 --- a/src/Components/Login.css +++ b/src/Components/Login.css @@ -302,6 +302,9 @@ form.sign-in-form { height: 48px; font-weight: 600; font-size: 0.8rem; + display: flex; + justify-content: center; + align-items: center; } .right-panel .image, .right-panel .content { diff --git a/src/Components/Login.js b/src/Components/Login.js index fd5fad2c..cefdc600 100644 --- a/src/Components/Login.js +++ b/src/Components/Login.js @@ -4,8 +4,8 @@ import './Login.css'; import '@fortawesome/fontawesome-free/css/all.min.css'; import logImg from './Profile/log.svg'; import registerImg from './Profile/register.svg'; -import homeIcon from './FreeLancer/homeicon.png' -import { auth, googleProvider } from './Firebase/Firebase.js'; +import homeIcon from './FreeLancer/homeicon.png'; +import { auth, googleProvider, githubProvider } from './Firebase/Firebase.js'; import { signInWithPopup } from "firebase/auth"; const LogIn = () => { @@ -14,29 +14,32 @@ const LogIn = () => { const [username, setUsername] = useState(''); const [showPassword, setShowPassword] = useState(false); const [isSignUpMode, setIsSignUpMode] = useState(false); - const [user, setUser] = useState({ - firstName: '', - lastname: '', - email: '', - password: '', - confirmPassword: '', - }); const navigate = useNavigate(); const handleGoogleSignIn = async () => { try { const result = await signInWithPopup(auth, googleProvider); const user = result.user; - const uid = user.uid; localStorage.setItem('user', JSON.stringify(user)); console.log("Google sign-in success:", user); - navigate("/"); } catch (error) { console.error("Google sign-in error:", error); } }; + const handleGitHubSignIn = async () => { + try { + const result = await signInWithPopup(auth, githubProvider); + const user = result.user; + localStorage.setItem('user', JSON.stringify(user)); + console.log("GitHub sign-in success:", user); + navigate("/"); + } catch (error) { + console.error("GitHub sign-in error:", error); + } + }; + const handleNextClick = async (e) => { e.preventDefault(); const emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; @@ -197,6 +200,9 @@ const LogIn = () => { +
Connect with Social Magic
Join the UniCollab community to collaborate and innovate with fellow students.
+Step into UniCollab with a social login or create a new account.
Welcome back! Log in to access your projects and collaborations.
+Sign in to continue your journey with UniCollab.