mitra-interactions-sdk 1.0.60-beta.6 → 1.0.60-beta.7

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.
package/dist/index.js CHANGED
@@ -449,7 +449,10 @@ async function emailLoginMitra2(options) {
449
449
  });
450
450
  const response = {
451
451
  token: data.token,
452
- baseURL: data.baseURL || authUrl,
452
+ // baseURL = authUrl usado (o gateway). NÃO usar data.baseURL da resposta:
453
+ // no novo Mitra o BFF pode devolver outro backURL e isso reescreveria a base
454
+ // (quebra no F5 quando o app persiste). authUrl e baseURL são o mesmo gateway.
455
+ baseURL: authUrl,
453
456
  // Guarda o refreshToken do login — é ele que vai no body do refresh depois.
454
457
  ...data.refreshToken ? { refreshToken: data.refreshToken } : {},
455
458
  ...data.integrationURL ? { integrationURL: data.integrationURL } : {}
@@ -485,7 +488,9 @@ async function refreshTokenSilently2(authUrl, _projectId) {
485
488
  const data = await postBffAuth(buildBffAuthEndpoint(authUrl, "/refresh-token"), { refreshToken });
486
489
  return {
487
490
  token: data.token,
488
- baseURL: data.baseURL || authUrl,
491
+ // Refresh NÃO muda a base — devolve o authUrl usado (gateway), nunca o
492
+ // data.baseURL da resposta (que reescreveria a base e quebra no F5).
493
+ baseURL: authUrl,
489
494
  ...data.refreshToken ? { refreshToken: data.refreshToken } : {},
490
495
  ...data.integrationURL ? { integrationURL: data.integrationURL } : {}
491
496
  };