Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
1e53fdfd
Commit
1e53fdfd
authored
May 29, 2026
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ApiClient fix auth
parent
6342dc30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
constructor/library/ApiClient.js
constructor/library/ApiClient.js
+1
-5
No files found.
constructor/library/ApiClient.js
View file @
1e53fdfd
this
.
ApiClient
=
class
{
this
.
ApiClient
=
class
{
constructor
()
{
constructor
()
{
this
.
_baseURL
=
`
${
window
.
location
.
origin
}
/Synergy`
;
this
.
_baseURL
=
`
${
window
.
location
.
origin
}
/Synergy`
;
this
.
_authHeader
=
this
.
_buildAuthHeader
();
this
.
_defaultAuthHeader
=
this
.
_buildDefaultAuthHeader
();
this
.
_requestInterceptors
=
[];
this
.
_requestInterceptors
=
[];
this
.
_responseInterceptors
=
[];
this
.
_responseInterceptors
=
[];
}
}
async
request
({
url
,
method
=
'
GET
'
,
body
,
headers
=
{},
defaultUser
=
false
})
{
async
request
({
url
,
method
=
'
GET
'
,
body
,
headers
=
{},
defaultUser
=
false
})
{
let
finalHeaders
=
this
.
_normalizeHeaders
({
let
finalHeaders
=
this
.
_normalizeHeaders
({
authorization
:
defaultUser
?
this
.
_
defaultAuthHeader
:
this
.
_authHeader
,
authorization
:
defaultUser
?
this
.
_
buildDefaultAuthHeader
()
:
this
.
_buildAuthHeader
()
,
...
headers
,
...
headers
,
});
});
...
@@ -57,7 +54,6 @@ this.ApiClient = class {
...
@@ -57,7 +54,6 @@ this.ApiClient = class {
try
{
try
{
response
=
await
fetch
(
config
.
url
,
config
);
response
=
await
fetch
(
config
.
url
,
config
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
({
config
,
msg
:
err
});
throw
this
.
_handleNetworkError
(
err
);
throw
this
.
_handleNetworkError
(
err
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment