Skip to content

Commit

Permalink
Update UserService.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Oct 9, 2023
1 parent 4da5ae8 commit 05a5f1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions mobile/config/env.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export const AXIOS_RETRIES_INTERVAL: number = 500
*/
export const DEFAULT_LANGUAGE: string = MI_DEFAULT_LANGUAGE || 'en'

/**
* Axios timeout in milliseconds.
*
* @type {number}
*/
export const AXIOS_TIMEOUT: number = 5000

/**
* Page size. Default is 20.
*
Expand Down
5 changes: 4 additions & 1 deletion mobile/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ export const validateAccessToken = async (): Promise<number> => {
.post(
`${Env.API_HOST}/api/validate-access-token`,
null,
{ headers }
{
headers,
timeout: Env.AXIOS_TIMEOUT,
}
)
.then((res) => res.status)
}
Expand Down

0 comments on commit 05a5f1b

Please sign in to comment.