Next.js Discord

Discord Forum

Index.html not rendering assets (password protected website, Vercel)

Unanswered
eL posted this in #help-forum
Open in Discord
eLOP
Hey people! I have a question -- πŸ™‹β€β™‚οΈ I hope I can ask this here.
I made a website, html, css, and a bit of js, using VScode and Git. I push it to Github, and then it's deployed using Vercel.

The website is password protected, using Vercel's environment variables I designed the landing page (index) with some assets (background.jpg, styles.css, and a font.woff2), and this is where you type the password to enter.

When I access the website on someone's phone, the landing page just looks like a raw html page. no assets rendering. After I type the password, and enter, and then go back to the landing page, it will render correctly.

My theory: before typing the password, the browser has no access to these assets, but once logged in, the assets will be cached, so it will work.

Can someone confirm me this? And how to fix it, I want these assets available "publicly" so that the browser can render them without password entered. Thx!!

.root/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ background.jpg
β”‚   β”œβ”€β”€ banner.jpg
β”‚   └── picuture.jpg
β”œβ”€β”€ fonts/
β”‚   β”œβ”€β”€ font.woff
β”‚   └── font.woff2
β”œβ”€β”€ js/
β”‚   └── script.js
β”œβ”€β”€ index.html
β”œβ”€β”€ page1.html
β”œβ”€β”€ page2.html
β”œβ”€β”€ page3.html
β”œβ”€β”€ styles.css
β”œβ”€β”€ index.css
β”œβ”€β”€ middlesware.js
└── vercel.json

3 Replies

Fire ant
nextjs?
@Fire ant nextjs?
eLOP
Yes, I'm using middleware.js. I suspect that it is there. Btw, I'm not a dev and just learning everything as I build. So any inputs are welcome!
I also lack the words to search Google effectively