mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 12:32:39 +00:00
update logout logic
This commit is contained in:
@@ -23,9 +23,17 @@ const Account = createClass({
|
|||||||
// Reset divider position
|
// Reset divider position
|
||||||
window.localStorage.removeItem('naturalcrit-pane-split');
|
window.localStorage.removeItem('naturalcrit-pane-split');
|
||||||
// Clear login cookie
|
// 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 = '/';
|
window.location = '/';
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
|
|||||||
Reference in New Issue
Block a user