Skip to content

Commit

Permalink
Merge branch 'pu/ccheng/force_login_outdated_client' into '2023.11'
Browse files Browse the repository at this point in the history
fix(Tinebase/js): force reload when login to outdated client

See merge request tine20/tine20!4696
  • Loading branch information
pschuele committed Jan 9, 2024
2 parents f8d673e + 9158010 commit 8e3e2c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tine20/Tinebase/Frontend/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,11 @@ protected function _getLoginSuccessResponse($username)
'jsonKey' => Tinebase_Core::get('jsonKey'),
'welcomeMessage' => "Welcome to Tine 2.0!"
);

try {
$response['assetHash'] = Tinebase_Frontend_Http_SinglePageApplication::getAssetHash();
} catch (Exception $e) {}

if (Tinebase_Core::get(Tinebase_Core::SESSION)->encourage_mfa) {
$response['encourage_mfa'] = true;
}
Expand Down
10 changes: 9 additions & 1 deletion tine20/Tinebase/js/LoginPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,17 @@ Tine.Tinebase.LoginPanel = Ext.extend(Ext.Panel, {
},

onLoginSuccess: function(response) {
var responseData = Ext.util.JSON.decode(response.responseText);
const responseData = Ext.util.JSON.decode(response.responseText);
if (responseData.success === true) {
Ext.MessageBox.wait(String.format(i18n._('Login successful. Loading {0}...'), Tine.title), i18n._('Please wait!'));

if (responseData?.assetHash && Tine.clientVersion.assetHash !== responseData.assetHash) {
Tine.Tinebase.common.reload({
keepRegistry: false,
clearCache: true
});
}

window.document.title = this.originalTitle;
response.responseData = responseData;
this.onLogin.call(this.scope, response);
Expand Down

0 comments on commit 8e3e2c7

Please sign in to comment.