Merge branch 'master' into addLocalLogin-#269

This commit is contained in:
G.Ambatte authored and GitHub committed 2022-04-13 14:30:02 +12:00
commit ad8d5bd8a0
20 files changed
+795 -480

No files matched your search

+10 -2
View File
@@ -24,9 +24,17 @@ const Account = createClass({
// Reset divider position
window.localStorage.removeItem('naturalcrit-pane-split');
// Clear login cookie
document.cookie = `nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;samesite=lax;${window.domain ? `domain=${window.domain}` : ''}`;
let domain = '';
if(window.location?.hostname) {
let domainArray = window.location.hostname.split('.');
if(domainArray.length > 2){
domainArray = [''].concat(domainArray.slice(-2));
}
domain = domainArray.join('.');
}
document.cookie = `nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;samesite=lax;${domain ? `domain=${domain}` : ''}`;
window.location = '/';
};
}
},
localLogin : async function(){