diff --git a/deadlock-plugins/deadlock-extension/src/config.prod.ts b/deadlock-plugins/deadlock-extension/src/config.prod.ts index 93648f3f7cd18f77b2e7c37fbf2f45773ea809fc..cf6b1eca8dd4876a5ebd91f6bde4341be0003bc1 100644 --- a/deadlock-plugins/deadlock-extension/src/config.prod.ts +++ b/deadlock-plugins/deadlock-extension/src/config.prod.ts @@ -2,7 +2,7 @@ export const KEYCLOAK_DEVICE_AUTH_URL = 'https://auth.deadlock.io/auth/realms/Deadlock/protocol/openid-connect/auth/device'; export const KEYCLOAK_TOKEN_CREATE_URL = 'https://auth.deadlock.io/auth/realms/Deadlock/protocol/openid-connect/token'; export const KEYCLOAK_USER_INFO_URL = 'https://auth.deadlock.io/auth/realms/Deadlock/protocol/openid-connect/userinfo'; -export const REGISTRY_MISSION_URL = 'registry.e-biz.fr/deadlock/deadlock-challenges'; +export const REGISTRY_MISSION_URL = 'registry.takima.io/deadlock/deadlock-challenges'; export const REJECT_UNAUTHORIZED = true; export const ENABLE_AUTOMATIC_SAVE = true; export const ENABLE_RECORDER_HTTP_SERVER = false; diff --git a/deadlock-plugins/deadlock-extension/src/config.staging.ts b/deadlock-plugins/deadlock-extension/src/config.staging.ts index 4067193b509cb6c7e8210b9ad9f2ac054a51b1c3..912c56c27d281d634df899e61b57166d2fc2a50a 100644 --- a/deadlock-plugins/deadlock-extension/src/config.staging.ts +++ b/deadlock-plugins/deadlock-extension/src/config.staging.ts @@ -4,7 +4,7 @@ export const KEYCLOAK_TOKEN_CREATE_URL = 'https://auth.staging.deadlock.io/auth/realms/Deadlock/protocol/openid-connect/token'; export const KEYCLOAK_USER_INFO_URL = 'https://auth.staging.deadlock.io/auth/realms/Deadlock/protocol/openid-connect/userinfo'; -export const REGISTRY_MISSION_URL = 'registry.e-biz.fr/deadlock/deadlock-challenges'; +export const REGISTRY_MISSION_URL = 'registry.takima.io/deadlock/deadlock-challenges'; export const REJECT_UNAUTHORIZED = true; export const ENABLE_AUTOMATIC_SAVE = true; export const ENABLE_RECORDER_HTTP_SERVER = false; diff --git a/deadlock-plugins/deadlock-extension/src/config.ts b/deadlock-plugins/deadlock-extension/src/config.ts index 850e35d0d6efc642905ba5ea30da33904c823cd0..21960df6fea4d8e530bc89caaf217a4219f82ab8 100644 --- a/deadlock-plugins/deadlock-extension/src/config.ts +++ b/deadlock-plugins/deadlock-extension/src/config.ts @@ -4,7 +4,7 @@ export const KEYCLOAK_TOKEN_CREATE_URL = 'https://auth.dev.deadlock.io/auth/realms/Deadlock/protocol/openid-connect/token'; export const KEYCLOAK_USER_INFO_URL = 'https://auth.dev.deadlock.io/auth/realms/Deadlock/protocol/openid-connect/userinfo'; -export const REGISTRY_MISSION_URL = 'registry.e-biz.fr/deadlock/deadlock-challenges'; +export const REGISTRY_MISSION_URL = 'registry.takima.io/deadlock/deadlock-challenges'; export const REJECT_UNAUTHORIZED = false; export const ENABLE_AUTOMATIC_SAVE = true; export const ENABLE_RECORDER_HTTP_SERVER = false; diff --git a/deadlock-plugins/deadlock-extension/src/core/callApi.service.ts b/deadlock-plugins/deadlock-extension/src/core/callApi.service.ts index ad487aabaf9e93d537198974f855414f3a8a41ea..afbd314b6ff18f6e0e9db2cded7e2b7a2bc01b57 100644 --- a/deadlock-plugins/deadlock-extension/src/core/callApi.service.ts +++ b/deadlock-plugins/deadlock-extension/src/core/callApi.service.ts @@ -29,15 +29,6 @@ export default class CallApiService { this.callApi.interceptors.request.use( async (config) => { let accessToken = await this.extensionStore.getAccessToken(); - - if (!accessToken) { - try { - this.controller.authenticate(); - accessToken = await this.extensionStore.getAccessToken(); - } catch (_error) { - return Promise.reject(_error); - } - } if (accessToken && config.headers) { config.headers['authorization'] = `BEARER ${accessToken}`; } @@ -77,11 +68,7 @@ export default class CallApiService { } else if (originalConfig._retry) { // IF REFRESH TOKEN NOT WORK, REQUEST NEW CONNECTION IN USER BROWSER try { - const { accessToken, refreshToken } = await this.keycloackConnection.getToken({ - openLink: Controller.openBrowserWithUrl, - }); - await this.extensionStore.setAccessToken(accessToken); - await this.extensionStore.setRefreshToken(refreshToken); + await this.controller.authenticate(); return this.callApi(originalConfig); } catch (_error) { return Promise.reject(_error);