WIP: POLYLANG ERROR --> Bricks is not loaded on other languages domains

Browser: Chrome 110
OS: Windows

Hello, I got website: https://nejlepsizubniimplantaty.cz/

When I use polylang, everything is fine while I using the https://nejlepsizubniimplantaty.cz/en/homepage → builder is running as normal.

When I switch Polylang to different languages - different domain, I am not able to run the Bricks editor and every time I got redirected to frontend version of the page.

So: https://dentalimplantsczechrepublic.com/?bricks=run gets redirected to https://dentalimplantsczechrepublic.com/ → so I cannot use Bricks in other languages.

Maybe I just need to register other domains sowhere in Bricks? → I try different htaccess / wp-confing adjustments → with no help.

Any opions / help is much much appreciated <3

1 Like

Hi,
Thanks so much for your report, welcome to the forum, and sorry for the late reply!

We have already received two reports by email and will update this thread as soon as the problem has been solved.

Best regards,
timmse

2 Likes

Hello, do you have ETA? Cause it’s completely unusable, when you use 3 domains, and you can edit pages only in default language… Thank you.

1 Like

No, unfortunately not. But we try to solve every problem as fast as possible.

Hello, solution anywhere near? Just need to pick solution for my next projects).

1 Like

Any news @timmse please?

The task status is “in progress” – I can’t say when it will be solved, but we…

:v:

1 Like

@alessykora @freedomdesigner Čau kluci :slight_smile:

We have dealt with this issue before in other tools too. The issue is that bricks runs on the frontend of the site and when you edit another polylang domain, it practically redirects to another site that you don’t have authentication cookies for.

To solve this, I wrote an automatic “loginer” on all domains defined in polylang (or manually configured via hook). When the user visits the admin dashboard (we only have this on the dashboard so it doesn’t run unnecessarily often), it triggers a javascript that logs the user to all other domains via wp ajax.

It’s a bit of a hackish solution, you have to modify CORS headers to do this and also set SameSite=None for auth cookies, which reduces security very slightly (to minimize risk, this login is only valid for 8 hours instead of the standard 14 days, but this can be easily changed in the code).

I’ve extracted the source code here:

We use a very similar solution also for logging between completely different sites. You just need to use a security key instead of WP security constants, which will be shared between sites, and modify the user ID selection.

1 Like

čau Vládíku,

thank you very much, I will try it as soon as I can. Looks great as always - I really appreciate your work.

Aleš

I was able to make it working with some changes in code because I use folder for mine WP installation. Thanks @smitka !!

I’m glad it’s working for you. :slightly_smiling_face: