Rayrun
← Back to Discord Forum

backend on different domain then fe

hey guys, I have a question

I have GKE autopilot setup, it is running BE,FE,DB and playwright. All works except that playwright cannot login. I suspect that it is because of different domains.

Fe is running on http://frontend:3000 and BE is running http://backend:8085 (service names)

Is there a way to solve this? Thanks

This thread is trying to answer question "Is there a way to solve the login issue in playwright due to frontend and backend running on different domains?"

10 replies
insane_rookstar
insane_rookstar

How do you start the servers? Are you sure they both running?

Yes, they are both running, if I add loadbalancer I can ping them, communicate with them, FE is actually communicating without issue with backend, it is set this way in nginx

But when I send login request to the backend, and then visit frontend, I am not authenticated

I suspect that this is bacause of different domains.

On local it works, both services are on localhost. On prod it is working because of the same domain

insane_rookstar
insane_rookstar

Cors?

insane_rookstar
insane_rookstar

Run tests in debug mode with dev tools open and track the requests for more details

Will check, thanks

tphillips8117

"Playwright can not log in" What happens? What error message(s) are you getting?

Seems like someone will be learning about CORS in their near future. Sounds exactly how the internet?

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.