Skip to content

Commit 826736a

Browse files
author
Hugo Marcellin
committed
Remove getToken
1 parent 64eebf0 commit 826736a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/utils/rest-api.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
backendFetchJson,
1818
backendFetchText,
1919
getRequestParamFromList,
20+
getUserToken,
2021
} from '@gridsuite/commons-ui';
2122

2223
const PREFIX_USER_ADMIN_SERVER_QUERIES =
@@ -38,11 +39,6 @@ const PREFIX_FILTERS_QUERIES =
3839
import.meta.env.VITE_API_GATEWAY + '/filter/v1/filters';
3940
const PREFIX_STUDY_QUERIES = import.meta.env.VITE_API_GATEWAY + '/study';
4041

41-
function getToken() {
42-
const state = store.getState();
43-
return state.user.id_token;
44-
}
45-
4642
export function connectNotificationsWsUpdateConfig() {
4743
const webSocketBaseUrl = document.baseURI
4844
.replace(/^http:\/\//, 'ws://')
@@ -54,7 +50,7 @@ export function connectNotificationsWsUpdateConfig() {
5450
APP_NAME;
5551

5652
const reconnectingWebSocket = new ReconnectingWebSocket(
57-
() => webSocketUrl + '&access_token=' + getToken()
53+
() => webSocketUrl + '&access_token=' + getUserToken()
5854
);
5955
reconnectingWebSocket.onopen = function () {
6056
console.info(
@@ -636,7 +632,7 @@ export function connectNotificationsWsUpdateDirectories() {
636632
'/notify?updateType=directories';
637633

638634
const reconnectingWebSocket = new ReconnectingWebSocket(
639-
() => webSocketUrl + '&access_token=' + getToken()
635+
() => webSocketUrl + '&access_token=' + getUserToken()
640636
);
641637
reconnectingWebSocket.onopen = function () {
642638
console.info(

0 commit comments

Comments
 (0)