It's my first project in nextJS so please don't blame me if it's super basic stuff. The problem is if person go to the home page it will redirect him to login page if his not authenticated. And login page is inheriting background picture from index page which isn't supposed to. And after logging in and going back to index page. Index page's background picture is half cut. Can't insert pictures because of my reputation :<
Here is how I'm adding background image to home page
<body style={{
backgroundImage: "url('https://images4.alphacoders.com/480/thumb-1920-48076.jpg')"
}}>`
It's how I'm routing
useEffect(() => {
if (loading) {
return;
}
if (user){
console.log('logged in');
fetchData(user.uid)}
else{
router.push("/login");}}, [user, loading]);```
Thank you.
I have no idea how to solve this. I added 2 different body css code to these pages.