Cleanup more rlspecauth/AuthAccountHash related code

This commit is contained in:
djmaze 2021-04-28 21:33:03 +02:00
parent 146b2c1001
commit a36a8113bb
7 changed files with 59 additions and 93 deletions

View file

@ -28,7 +28,6 @@ export class AbstractApp {
logoutReload(close = false) {
const url = logoutLink();
rl.hash.clear();
close && window.close && window.close();
if (location.href !== url) {

View file

@ -38,7 +38,7 @@ export function logoutLink() {
*/
export function serverRequestRaw(type, hash, customSpecSuffix) {
return SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/'
+ (null == customSpecSuffix ? rl.hash.get() : customSpecSuffix) + '/'
+ (null == customSpecSuffix ? '0' : customSpecSuffix) + '/'
+ (type
? type + '/' + (hash ? SUB_QUERY_PREFIX + '/' + hash : '')
: '')
@ -59,7 +59,7 @@ export function attachmentDownload(download, customSpecSuffix) {
* @returns {string}
*/
export function serverRequest(type) {
return SERVER_PREFIX + '/' + type + '/' + SUB_QUERY_PREFIX + '/' + rl.hash.get() + '/';
return SERVER_PREFIX + '/' + type + '/' + SUB_QUERY_PREFIX + '/0/';
}
/**

View file

@ -24,9 +24,8 @@ checkResponseError = data => {
) {
++iJsonErrorCount;
}
if (data.ClearAuth || data.Logout || 7 < iJsonErrorCount) {
rl.hash.clear();
data.ClearAuth || rl.logoutReload();
if (data.Logout || 7 < iJsonErrorCount) {
rl.logoutReload();
}
}
},

View file

@ -85,14 +85,9 @@ doc.documentElement.classList.toggle('rl-mobile', 'mobile' === layout || (!layou
let pStep = 0,
progress = eId('progressjs'),
rlspecauth = '',
RL_APP_DATA = {};
win.rl = {
hash: {
get: () => rlspecauth || '0',
clear: () => rlspecauth = ''
},
data: () => RL_APP_DATA,
adminArea: () => admin,
settings: {
@ -114,7 +109,6 @@ win.rl = {
initData: appData => {
RL_APP_DATA = appData;
rlspecauth = appData['AuthAccountHash'];
if (appData) {
loadScript(appData.StaticLibJsLink)
@ -137,7 +131,7 @@ Storage('local');
eId('app-css').href = eId('app-css').dataset.href;
loadScript(`./?/${admin ? 'Admin' : ''}AppData/${rl.hash.get()}/${Math.random().toString().substr(2)}/`)
loadScript(`./?/${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().substr(2)}/`)
.then(() => {});
})(this);