# Update authenticated user at re-login

**URL:** <https://community.hubspot.com/t/update-authenticated-user-at-re-login/67820>\
**Category:** CMS Development\
**Tags:** javascript\
**Created:** [October 25, 2022, 11:18am UTC](https://community.hubspot.com/t/update-authenticated-user-at-re-login/67820 "2022-10-25T11:18:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GC5](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@GC5](https://community.hubspot.com/u/GC5)\
**Post date:** [October 25, 2022, 11:18am UTC](https://community.hubspot.com/t/update-authenticated-user-at-re-login/67820/1 "2022-10-25T11:18:12Z")

</div>

Hi everyone, i am trying to integrate hubspot chat with javascript code, and i am having a problem.

Theese are may steps:

1. loading the chat with the method:

`window.HubSpotConversations.widget.load() `

2. Passing email and token of the authenticated user in the settings:

```lia-code-sample
window.hsConversationsSettings = {
loadImmediately: false,
identification Email: myEmail,
identificationToken: myToken,
};

```

3. After a conversation, when the user logout I perform these cleaning operations:

```lia-code-sample
window.HubSpotConversations.clear();
window.HubSpotConversations.widget.remove();

```

4. Now, if another user with different email and token login, the previous conversation remains and when the message is sent I find the previous user in the inbox.

Am I doing something wrong? how can I solve this problem?

Thanks,

GC5

---

<div class="post-metadata">

**Author:** ![kvlschaefer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kvlschaefer/32/71076_2.png) [@kvlschaefer](https://community.hubspot.com/u/kvlschaefer)\
**Post date:** [October 27, 2022, 11:18am UTC](https://community.hubspot.com/t/update-authenticated-user-at-re-login/67820/2 "2022-10-27T11:18:57Z")

</div>

Hi @GC5,

Thank you for reaching out to the Community!

I wanted to invite our subject matter experts to see if they have insight.

Hi @LMeert, [@Mike\_Eastwood](https://community.hubspot.com/t5/user/viewprofilepage/user-id/9259), @himanshurauthan - Have you integrated javascript with HubSpot chat like @GC5 is describing?

Thank you!

Best,

Kristen

---

<div class="post-metadata">

**Author:** ![GC5](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@GC5](https://community.hubspot.com/u/GC5)\
**Post date:** [October 28, 2022, 11:23am UTC](https://community.hubspot.com/t/update-authenticated-user-at-re-login/67820/3 "2022-10-28T11:23:14Z")

</div>

I am still waiting for a reply to this post.
