diff options
author | 2019-03-12 18:43:43 +0100 | |
---|---|---|
committer | 2019-03-12 18:43:43 +0100 | |
commit | dc6d91e179cea94e8653cf7b568a143ce4ac3887 (patch) | |
tree | 30171a818f8dd643ea2ff3629f636a9db663e7b5 /src/api/utils/auth.js | |
parent | refactor server api to use prepare auth request util (diff) | |
download | ferdium-app-dc6d91e179cea94e8653cf7b568a143ce4ac3887.tar.gz ferdium-app-dc6d91e179cea94e8653cf7b568a143ce4ac3887.tar.zst ferdium-app-dc6d91e179cea94e8653cf7b568a143ce4ac3887.zip |
refactor server api even more
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 d469853a5..6dbdeaa7f 100644 --- a/src/api/utils/auth.js +++ b/src/api/utils/auth.js | |||
@@ -3,7 +3,7 @@ import localStorage from 'mobx-localstorage'; | |||
3 | 3 | ||
4 | const { app } = remote; | 4 | const { app } = remote; |
5 | 5 | ||
6 | export const prepareAuthRequest = (options, auth = true) => { | 6 | export const prepareAuthRequest = (options = { method: 'GET' }, auth = true) => { |
7 | const request = Object.assign(options, { | 7 | const request = Object.assign(options, { |
8 | mode: 'cors', | 8 | mode: 'cors', |
9 | headers: Object.assign({ | 9 | headers: Object.assign({ |
@@ -23,6 +23,6 @@ export const prepareAuthRequest = (options, auth = true) => { | |||
23 | return request; | 23 | return request; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | export const sendAuthRequest = (url, options) => ( | 26 | export const sendAuthRequest = (url, options, auth) => ( |
27 | window.fetch(url, prepareAuthRequest(options)) | 27 | window.fetch(url, prepareAuthRequest(options, auth)) |
28 | ); | 28 | ); |