trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io
184 stars 7 forks source link

Users are receiving regular 401 responses #439

Closed frlefebvre closed 8 months ago

frlefebvre commented 8 months ago

Hi there,

I've had a handful of reports of users seemingly getting disconnected from Trakt. Looking into it, it appears that the cause is that the app (Sequel) is getting 401 responses. The reports mention that disconnecting and reconnecting works for some time but eventually, the app gets "disconnected".

I've been investigating the issue with one user in particular and so far I'm not seeing anything obviously wrong with how the app behaves. In one instance:

This user contacted support and they could not see anything wrong on their end either. What would be the reasons for getting a 401 beyond not providing authentication (which I'm certain the app is doing)?

rectifyer commented 8 months ago

Hmm, that's a weird one. A 401 is only returned if the OAuth is deemed invalid (or missing). Since it's being sent, that likely means the token was revoked, either by the app or the user. If you have a specific access token, please email support@trakt.tv and I can check if it is revoked and when.

frlefebvre commented 8 months ago

Alright, I'll ask the user to reach out with their token the next time they get disconnected!

frlefebvre commented 8 months ago

For some reason, macOS decided to open the app in the background after a user signed in on iOS. Long story short, the Mac app had a token but no sync date at this point and assumed the first connection failed and signed out the user so they could start over. The issue has been fixed on my side now that I know this is a thing macOS does. 😅

rectifyer commented 8 months ago

That's a weird one! Glad you were able to figure it out and this should help other devs who have a Mac compatible app too.