# Update authenticated user at re-login

**URL:** <https://community.hubspot.com/t/update-authenticated-user-at-re-login/68503>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [November 3, 2022, 4:29pm UTC](https://community.hubspot.com/t/update-authenticated-user-at-re-login/68503 "2022-11-03T16:29:20Z")\
**Posts on this page:** 2\
**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:** [November 3, 2022, 4:29pm UTC](https://community.hubspot.com/t/update-authenticated-user-at-re-login/68503/1 "2022-11-03T16:29:20Z")

</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:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [November 3, 2022, 8:23pm UTC](https://community.hubspot.com/t/update-authenticated-user-at-re-login/68503/2 "2022-11-03T20:23:19Z")

</div>

Hi, @GC5 👋 Thanks for reaching out. Hey, @LMeert @Teun, do you have any feedback or tips on how @GC5? Is there any additional information or context they can provide that is helpful?

Thank you very much for taking a look! — Jaycee
