mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Cleanup AuthAccountHash handling
This commit is contained in:
parent
8e5d56e15f
commit
146b2c1001
8 changed files with 32 additions and 130 deletions
|
|
@ -1,14 +1,12 @@
|
|||
import { pString, pInt } from 'Common/Utils';
|
||||
import { Settings, SettingsGet } from 'Common/Globals';
|
||||
import { Settings } from 'Common/Globals';
|
||||
|
||||
const
|
||||
ROOT = './',
|
||||
HASH_PREFIX = '#/',
|
||||
SERVER_PREFIX = './?',
|
||||
VERSION = Settings.app('version'),
|
||||
VERSION_PREFIX = Settings.app('webVersionPath') || 'snappymail/v/' + VERSION + '/',
|
||||
|
||||
getHash = () => SettingsGet('AuthAccountHash') || '0';
|
||||
VERSION_PREFIX = Settings.app('webVersionPath') || 'snappymail/v/' + VERSION + '/';
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
|
|
@ -40,7 +38,7 @@ export function logoutLink() {
|
|||
*/
|
||||
export function serverRequestRaw(type, hash, customSpecSuffix) {
|
||||
return SERVER_PREFIX + '/Raw/' + SUB_QUERY_PREFIX + '/'
|
||||
+ (null == customSpecSuffix ? getHash() : customSpecSuffix) + '/'
|
||||
+ (null == customSpecSuffix ? rl.hash.get() : customSpecSuffix) + '/'
|
||||
+ (type
|
||||
? type + '/' + (hash ? SUB_QUERY_PREFIX + '/' + hash : '')
|
||||
: '')
|
||||
|
|
@ -61,7 +59,7 @@ export function attachmentDownload(download, customSpecSuffix) {
|
|||
* @returns {string}
|
||||
*/
|
||||
export function serverRequest(type) {
|
||||
return SERVER_PREFIX + '/' + type + '/' + SUB_QUERY_PREFIX + '/' + getHash() + '/';
|
||||
return SERVER_PREFIX + '/' + type + '/' + SUB_QUERY_PREFIX + '/' + rl.hash.get() + '/';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue