I’ve been able to setup firebase auth in dev and it works fine, but it fails when deployed to vercel.
Error message log on deployment
I’ve also built the project locally without any issues.
Been trying to understand why am having this issue for days now.
import { signInWithEmailAndPassword } from 'firebase/auth';
import { useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { auth } from '../client/client'
const Login = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const navigate = useNavigate();
const handleSubmit = async (e) => {
e.preventDefault();
try {
const userCredential = await signInWithEmailAndPassword(auth, email, password);
console.log(userCredential);
const user = userCredential.user;
sessionStorage.setItem('token', user.accessToken);
sessionStorage.setItem('user', JSON.stringify(user));
navigate("/home");
} catch (error) {
console.error(error);
}
}
New contributor
Lemon Confidence is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.