analytica-frontend-lib 1.1.2 → 1.1.3

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.mjs CHANGED
@@ -7050,6 +7050,25 @@ var handleProfileSelection = (responseData, setSelectedProfile) => {
7050
7050
  });
7051
7051
  }
7052
7052
  };
7053
+ var handleUserData = (responseData, setUser) => {
7054
+ if (!setUser) return;
7055
+ if (!hasValidProfileData(responseData)) return;
7056
+ const userId = responseData.userId;
7057
+ const userName = responseData.userName;
7058
+ const userEmail = responseData.userEmail;
7059
+ if (userId) {
7060
+ const userData = {
7061
+ id: userId
7062
+ };
7063
+ if (userName) {
7064
+ userData.name = userName;
7065
+ }
7066
+ if (userEmail) {
7067
+ userData.email = userEmail;
7068
+ }
7069
+ setUser(userData);
7070
+ }
7071
+ };
7053
7072
  function useUrlAuthentication(options) {
7054
7073
  const location = useLocation2();
7055
7074
  useEffect12(() => {
@@ -7070,6 +7089,7 @@ function useUrlAuthentication(options) {
7070
7089
  });
7071
7090
  options.setSessionInfo(response.data.data);
7072
7091
  handleProfileSelection(response.data.data, options.setSelectedProfile);
7092
+ handleUserData(response.data.data, options.setUser);
7073
7093
  options.clearParamsFromURL?.();
7074
7094
  } catch (error) {
7075
7095
  console.error("Erro ao obter informa\xE7\xF5es da sess\xE3o:", error);
@@ -7080,6 +7100,7 @@ function useUrlAuthentication(options) {
7080
7100
  location.search,
7081
7101
  options.setSessionInfo,
7082
7102
  options.setSelectedProfile,
7103
+ options.setUser,
7083
7104
  options.setTokens,
7084
7105
  options.api,
7085
7106
  options.endpoint,