Skip to content

Commit 8b04d56

Browse files
feat: this commit introduces clients for profiles and identity using httpClient and federationClient
1 parent a5e51d4 commit 8b04d56

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

UIs/Landing/lib/axios.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ export const httpClient = axios.create({
55
baseURL: process.env.NEXT_PUBLIC_API_URL,
66
headers: {
77
"Content-Type": "application/json"
8-
}
8+
},
9+
validateStatus: () => true
910
});
1011

1112
export const federationClient = axios.create({
1213
baseURL: process.env.NEXT_PUBLIC_FEDERATION_API_URL,
1314
headers: {
1415
"Content-Type": "application/json",
1516
"Realm": process.env.NEXT_PUBLIC_REALM
16-
}
17+
},
18+
validateStatus: () => true
1719
});
1820

19-
2021
httpClient.interceptors.request.use((configuration) => {
2122
const token = typeof window !== "undefined"
2223
? localStorage.getItem(LocalStorage.AccessToken)

UIs/Landing/lib/clients.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { ProfilesClient } from "@/http/clients/profiles-client";
2+
import { federationClient, httpClient } from "./axios";
3+
import { IdentityClient } from "@/http/clients/identity-client";
4+
5+
export const profilesClient = new ProfilesClient(httpClient);
6+
export const identityClient = new IdentityClient(federationClient);

0 commit comments

Comments
 (0)