diff options
author | 2022-07-25 08:16:50 +0530 | |
---|---|---|
committer | 2022-07-25 08:17:10 +0530 | |
commit | cf282aa351cbc58691fb1b2fb4764830247cdbe8 (patch) | |
tree | 1a6ac4c9abd8b3de9d358016a5065da86cdd8510 /src/api/utils/auth.ts | |
parent | 6.0.1-nightly.3 [skip ci] (diff) | |
download | ferdium-app-cf282aa351cbc58691fb1b2fb4764830247cdbe8.tar.gz ferdium-app-cf282aa351cbc58691fb1b2fb4764830247cdbe8.tar.zst ferdium-app-cf282aa351cbc58691fb1b2fb4764830247cdbe8.zip |
eslint needs to be executed at the top-level to actually workv6.0.1-nightly.3
Diffstat (limited to 'src/api/utils/auth.ts')
-rw-r--r-- | src/api/utils/auth.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/api/utils/auth.ts b/src/api/utils/auth.ts index 282d00459..1f694a781 100644 --- a/src/api/utils/auth.ts +++ b/src/api/utils/auth.ts | |||
@@ -31,15 +31,17 @@ export const prepareAuthRequest = ( | |||
31 | return request; | 31 | return request; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | export const prepareLocalToken = async ( | 34 | export const prepareLocalToken = async (requestData: { |
35 | requestData: { method: string; headers?: any; body?: any }, | 35 | method: string; |
36 | ) => { | 36 | headers?: any; |
37 | body?: any; | ||
38 | }) => { | ||
37 | await when(() => !needsToken() || !!localServerToken(), { timeout: 2000 }); | 39 | await when(() => !needsToken() || !!localServerToken(), { timeout: 2000 }); |
38 | const token = localServerToken(); | 40 | const token = localServerToken(); |
39 | if (token) { | 41 | if (token) { |
40 | requestData.headers['X-Ferdium-Local-Token'] = token; | 42 | requestData.headers['X-Ferdium-Local-Token'] = token; |
41 | } | 43 | } |
42 | } | 44 | }; |
43 | 45 | ||
44 | export const sendAuthRequest = async ( | 46 | export const sendAuthRequest = async ( |
45 | url: RequestInfo, | 47 | url: RequestInfo, |