corpushub-design-system 0.0.19 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios';
2
+ import { attachBearerFromSession, installAuthRefreshInterceptor, } from './installAuthRefreshInterceptor';
2
3
  import { clearSession, setAccessToken, setRefreshAccessTokenImpl, } from './session';
3
4
  const authApi = axios.create({
4
5
  withCredentials: true,
@@ -14,6 +15,11 @@ const authApiBase = import.meta.env.VITE_APP_AUTH_API ?? '';
14
15
  if (authApiBase) {
15
16
  configureAuthApiBaseUrl(authApiBase);
16
17
  }
18
+ installAuthRefreshInterceptor(authApi);
19
+ authApi.interceptors.request.use((config) => {
20
+ attachBearerFromSession(config);
21
+ return config;
22
+ });
17
23
  /** Gateway: `/api/auth/refresh` → auth service `/auth/refresh` (StripPrefix=1 drops `/api` only). */
18
24
  setRefreshAccessTokenImpl(async () => {
19
25
  try {
@@ -1,9 +1,9 @@
1
- import api from '../api';
1
+ import authApi from '../auth/authApi';
2
2
  function updateLiveTour(liveTour) {
3
- return api.patch(`${import.meta.env.VITE_APP_AUTH_API}/profile/live-tour`, { liveTour });
3
+ return authApi.patch('/profile/live-tour', { liveTour });
4
4
  }
5
5
  function updateSettings(settings) {
6
- return api.patch(`${import.meta.env.VITE_APP_AUTH_API}/profile/settings`, { settings });
6
+ return authApi.patch('/profile/settings', { settings });
7
7
  }
8
8
  const ProfileService = {
9
9
  updateLiveTour,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corpushub-design-system",
3
3
  "private": false,
4
- "version": "0.0.19",
4
+ "version": "0.0.20",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {