# Issue with refreshing token for user

**URL:** <https://staging-discuss.dev.twitch.com/t/issue-with-refreshing-token-for-user/46435>\
**Category:** API\
**Created:** [July 8, 2023, 1:04pm UTC](https://staging-discuss.dev.twitch.com/t/issue-with-refreshing-token-for-user/46435 "2023-07-08T13:04:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thedanives](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/thedanives/32/25375_2.png) [@thedanives](https://staging-discuss.dev.twitch.com/u/thedanives)\
**Post date:** [July 8, 2023, 1:04pm UTC](https://staging-discuss.dev.twitch.com/t/issue-with-refreshing-token-for-user/46435/1 "2023-07-08T13:04:50Z")

</div>

Hi,

I’m using Python to log into a Twitch account to act as a chat bot. This has been working fine, however last night I suddenly received the error message:

```auto
Login unsuccessful with token " ****". Check your scopes for "chat_login" and try again.

```

I’ve not received this before. I tried refreshing the token and got the same error - and from what I can tell, “chat\_login” is a deprecated feature/code? I checked the library I’m using which makes no mention of this wording, so I assume it came from Twitch.

In the end I went back through the manual auth process and that fixed the integration, but I’m concerned that this might happen again and I want to know how I might be able to combat it without having to re-login - or if this was a ‘glitch’ on Twitchs end (this example happened 2023-07-08T00:47:07.721+01:00).

For some extra information, I’m using `https://id.twitch.tv/oauth2/validate` for logging in, and TwitchIO for connecting to chat, which is connecting via `wss://irc-ws.chat.twitch.tv:443`

Thanks,

Dan

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [August 7, 2023, 1:05pm UTC](https://staging-discuss.dev.twitch.com/t/issue-with-refreshing-token-for-user/46435/2 "2023-08-07T13:05:05Z")

</div>

Closed on August 7, 2023, 1:05pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
