mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Resolve #537
This commit is contained in:
parent
bb77d0ae02
commit
c83cf64b80
3 changed files with 9 additions and 5 deletions
|
|
@ -37,8 +37,6 @@ try {
|
||||||
smctoken = encodeURIComponent(btoa(String.fromCharCode(...data)));
|
smctoken = encodeURIComponent(btoa(String.fromCharCode(...data)));
|
||||||
}
|
}
|
||||||
localStorage.setItem('smctoken', smctoken);
|
localStorage.setItem('smctoken', smctoken);
|
||||||
// doc.cookie = `smctoken=${smctoken};path=${doc.location.pathname};samesite=strict;secure";
|
|
||||||
// doc.cookie = 'smctoken='+smctoken+";path=/;samesite=lax";
|
|
||||||
doc.cookie = 'smctoken='+smctoken+";path=/;samesite=strict";
|
doc.cookie = 'smctoken='+smctoken+";path=/;samesite=strict";
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
|
||||||
|
|
@ -180,8 +180,14 @@ abstract class Service
|
||||||
if ($sResult) {
|
if ($sResult) {
|
||||||
$sResult .= '<!--cached-->';
|
$sResult .= '<!--cached-->';
|
||||||
} else {
|
} else {
|
||||||
|
$SameSite = \strtolower($oConfig->Get('security', 'cookie_samesite', 'Strict'));
|
||||||
|
$Secure = (isset($_SERVER['HTTPS']) || 'none' == $SameSite) ? ';secure' : '';
|
||||||
$aTemplateParameters['{{BaseAppBootCss}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/css/boot'.$sAppCssMin.'.css');
|
$aTemplateParameters['{{BaseAppBootCss}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/css/boot'.$sAppCssMin.'.css');
|
||||||
$aTemplateParameters['{{BaseAppBootScript}}'] = \file_get_contents(APP_VERSION_ROOT_PATH.'static/js'.($sAppJsMin ? '/min' : '').'/boot'.$sAppJsMin.'.js');
|
$aTemplateParameters['{{BaseAppBootScript}}'] = \str_replace(
|
||||||
|
'samesite=strict',
|
||||||
|
"samesite={$SameSite}{$Secure}",
|
||||||
|
\file_get_contents(APP_VERSION_ROOT_PATH.'static/js'.($sAppJsMin ? '/min' : '').'/boot'.$sAppJsMin.'.js')
|
||||||
|
);
|
||||||
$aTemplateParameters['{{BaseAppMainCssLink}}'] = Utils::WebStaticPath('css/'.($bAdmin ? 'admin' : 'app').$sAppCssMin.'.css');
|
$aTemplateParameters['{{BaseAppMainCssLink}}'] = Utils::WebStaticPath('css/'.($bAdmin ? 'admin' : 'app').$sAppCssMin.'.css');
|
||||||
$aTemplateParameters['{{BaseAppThemeCss}}'] = \preg_replace('/\\s*([:;{},]+)\\s*/s', '$1', $oActions->compileCss($sThemeName, $bAdmin));
|
$aTemplateParameters['{{BaseAppThemeCss}}'] = \preg_replace('/\\s*([:;{},]+)\\s*/s', '$1', $oActions->compileCss($sThemeName, $bAdmin));
|
||||||
$aTemplateParameters['{{BaseLanguage}}'] = $oActions->compileLanguage($sLanguage, $bAdmin);
|
$aTemplateParameters['{{BaseLanguage}}'] = $oActions->compileLanguage($sLanguage, $bAdmin);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue