Skip to content

Commit

Permalink
Merge branch 'fix-auth-token' into 'dev'
Browse files Browse the repository at this point in the history
fix when auth token does not exists

See merge request ergo/rosen-bridge/network-client!24
  • Loading branch information
vorujack committed Apr 29, 2024
2 parents 0d10b63 + 4c7b9f1 commit ca604a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/cardano-koios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rosen-clients/cardano-koios",
"version": "2.0.2",
"version": "2.0.3",
"description": "A client library for Cardano Koios",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
11 changes: 8 additions & 3 deletions clients/cardano-koios/src/api/koiosAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,14 @@ import {
} from '../axios';

export const getKoiosAPI = (url: string, authToken?: string) => {
const instance = createAxiosInstanceWithHeaders(url, {
Authorization: `Bearer ${authToken}`,
});
const instance = createAxiosInstanceWithHeaders(
url,
authToken
? {
Authorization: `Bearer ${authToken}`,
}
: {}
);

/**
* Get the tip info about the latest block seen by chain
Expand Down

0 comments on commit ca604a5

Please sign in to comment.