RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.62k stars 10.62k forks source link

After SAML Login the loading screen stays open #23569

Open Czujackt opened 3 years ago

Czujackt commented 3 years ago

Description:

We use SAML with Keycloak for login to Rocket.Chat. When you complete the login in the browser, the loading screen stays open.

Actual behavior:

Bildschirmfoto 2021-10-27 um 08 40 35

Server Setup Information:

Client Setup Information

Relevant logs:

Logs from BROWSER

[Error] Error: No callback invoker for method 3
(anonyme Funktion) — aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:772:16473
forEach
_process_updated — aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:772:15890
_processOneDataMessage — aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:772:12800
_livedata_data — aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:772:13389
u — aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:999:275747
(anonyme Funktion) — aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:999:275923
(anonyme Funktion) — aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:1:8268
promiseReactionJob

    (anonyme Funktion) (aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:999:276076)
    (anonyme Funktion) (aa1d4ab72b86a914f2f370581f059e8299cabbb6.js:1:8268)
    promiseReactionJob
Czujackt commented 3 years ago

Can someone help here

maeries commented 3 years ago

do you have two factor authentication enabled? That caused a similar problem for me. see #23606

Czujackt commented 3 years ago

I have tried this, but it makes no difference. My problem is independent of the two factor authentication

Nektovet commented 2 years ago

@Czujackt Did you solve the problem? I just caught the same issue

Czujackt commented 2 years ago

@Nektovet No. After constant refreshing of the page it works then eventually.

imedia3 commented 2 years ago

Same problem, 4.8, 5.0, 5.0.4, 5.1.4, 5.2rc4, with all these versions we have the same issue.

1) When logging in via SAML, Rocketchat loads blank screen, after refreshing the page (F5) - everything renders. 2) If you log in via standard login form - the page renders with first load. 3) No specific logs in Keycloak or Rocketchat. 4) Google Chrome console logs: image 5) Page's code contains exactly the same code when we see blank page and normal page.

I finished up with a temporary solution by adding following code for authorized users (Settings > Layout > Custom Scripts > Authorized users):

if(!window.location.hash) {
       window.location = window.location + '#loaded';
       window.location.reload();
     };
gabe565 commented 1 year ago

I finished up with a temporary solution by adding following code for authorized users (Settings > Layout > Custom Scripts > Authorized users):

Thanks for the workaround! This worked well for me, but I didn't like adding a hash to the URL. Instead, I added a custom script for logged out users that sets a value in localStorage, and another custom script for logged in users that checks the value, removes it, then refreshes the page.

Custom Script for Logged Out Users

localStorage.setItem("will-refresh", "true");

Custom Script for Logged In Users

if (localStorage.getItem("will-refresh") === "true") {
  localStorage.removeItem("will-refresh");
  window.location.reload();
}
imedia3 commented 1 year ago

I finished up with a temporary solution by adding following code for authorized users (Settings > Layout > Custom Scripts > Authorized users):

Thanks for the workaround! This worked well for me, but I didn't like adding a hash to the URL. Instead, I added a custom script for logged out users that sets a value in localStorage, and another custom script for logged in users that checks the value, removes it, then refreshes the page.

Custom Script for Logged Out Users

localStorage.setItem("will-refresh", "true");

Custom Script for Logged In Users

if (localStorage.getItem("will-refresh") === "true") {
  localStorage.removeItem("will-refresh");
  window.location.reload();
}

It is a better solution for my case too, thank for sharing, it is working well