feat(http-request): add headers support

This commit is contained in:
Ali BARIN
2023-03-16 22:55:28 +00:00
parent 75bbd16b0c
commit b1ee3ef8ba
3 changed files with 43 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ const appInfoConverter = (rawAppData: IApp) => {
if (rawAppData.auth?.fields) {
rawAppData.auth.fields = rawAppData.auth.fields.map((field) => {
if (typeof field.value === 'string') {
if (field.type === 'string' && typeof field.value === 'string') {
return {
...field,
value: field.value.replace('{WEB_APP_URL}', appConfig.webAppUrl),

View File

@@ -47,6 +47,7 @@ export default function createHttpClient({
if (
// TODO: provide a `shouldRefreshToken` function in the app
(status === 401 || status === 403) &&
$.app.auth &&
$.app.auth.refreshToken &&
!$.app.auth.isRefreshTokenRequested
) {