diff options
author | 2021-08-13 08:18:13 +0530 | |
---|---|---|
committer | 2021-08-13 07:32:56 +0000 | |
commit | 5130935ad52c149837fd45e936c943223d13dfc4 (patch) | |
tree | 442283749984f39efba450981c22716c84e613a3 /src/api/utils/auth.js | |
parent | refactor: Use destructured 'import' (diff) | |
download | ferdium-app-5130935ad52c149837fd45e936c943223d13dfc4.tar.gz ferdium-app-5130935ad52c149837fd45e936c943223d13dfc4.tar.zst ferdium-app-5130935ad52c149837fd45e936c943223d13dfc4.zip |
chore: Refactoring to reuse already defined constants
Diffstat (limited to 'src/api/utils/auth.js')
-rw-r--r-- | src/api/utils/auth.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/utils/auth.js b/src/api/utils/auth.js index 9f718f171..e493b2962 100644 --- a/src/api/utils/auth.js +++ b/src/api/utils/auth.js | |||
@@ -1,5 +1,5 @@ | |||
1 | import { app } from '@electron/remote'; | ||
2 | import localStorage from 'mobx-localstorage'; | 1 | import localStorage from 'mobx-localstorage'; |
2 | import { ferdiLocale, ferdiVersion } from '../../environment'; | ||
3 | 3 | ||
4 | export const prepareAuthRequest = (options = { method: 'GET' }, auth = true) => { | 4 | export const prepareAuthRequest = (options = { method: 'GET' }, auth = true) => { |
5 | const request = Object.assign(options, { | 5 | const request = Object.assign(options, { |
@@ -7,10 +7,10 @@ export const prepareAuthRequest = (options = { method: 'GET' }, auth = true) => | |||
7 | headers: { | 7 | headers: { |
8 | 'Content-Type': 'application/json', | 8 | 'Content-Type': 'application/json', |
9 | 'X-Franz-Source': 'desktop', | 9 | 'X-Franz-Source': 'desktop', |
10 | 'X-Franz-Version': app.getVersion(), | 10 | 'X-Franz-Version': ferdiVersion, |
11 | 'X-Franz-platform': process.platform, | 11 | 'X-Franz-platform': process.platform, |
12 | 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), | 12 | 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), |
13 | 'X-Franz-System-Locale': app.getLocale(), | 13 | 'X-Franz-System-Locale': ferdiLocale, |
14 | ...options.headers, | 14 | ...options.headers, |
15 | }, | 15 | }, |
16 | }); | 16 | }); |