mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
Resolve #713
This commit is contained in:
parent
b89d194863
commit
4085f58b4e
2 changed files with 19 additions and 4 deletions
13
dev/boot.js
13
dev/boot.js
|
|
@ -31,6 +31,19 @@ const
|
|||
navigator.cookieEnabled || redirect('NoCookie');
|
||||
[].flat || redirect('BadBrowser');
|
||||
|
||||
try {
|
||||
let smctoken = localStorage.getItem('smctoken');
|
||||
if (!smctoken) {
|
||||
let data = new Uint8Array(16);
|
||||
crypto.getRandomValues(data);
|
||||
smctoken = btoa(String.fromCharCode(...data));
|
||||
localStorage.setItem('smctoken', smctoken);
|
||||
}
|
||||
document.cookie = 'smctoken='+encodeURIComponent(smctoken)+"; path=/; samesite=strict";
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
let RL_APP_DATA = {};
|
||||
|
||||
doc.documentElement.classList.toggle('rl-mobile', 'mobile' === layout[2] || (!layout && 1000 > innerWidth));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue