timoschlueter / nightscout-librelink-up

Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout.
MIT License
192 stars 246 forks source link

[error]: {"message":"invalid or expired jwt"} #82

Closed JotaMyke closed 5 months ago

JotaMyke commented 1 year ago

I haven't collected data from libreview for about a month. I redeployed from 1.9.0 to 1.9.1 and it's still the same - AuthFailureError . I assume this happened after updating librelinkup to 4.5.0.

Log from rail.app:

nightscout-librelink-up@1.9.1 start node index.js [info]: Starting cron schedule: /5 * [info]: no authTicket.expires [info]: renew token [info]: Logged in to LibreLink Up [error]: {"message":"invalid or expired jwt"} [error]: getting libreLinkUpConnection: Cannot read properties of undefined (reading 'data')

timoschlueter commented 1 year ago

Did it work for you in the past? Do you have data available in the LibreLink Up App on your phone using the same credentials as set in the environment variables?

JotaMyke commented 1 year ago

Yes, the data in my phone's LibreLink Up app has the same credentials defined in the environment variables.

timoschlueter commented 1 year ago

Do you have special characters in your password? Maybe that's causing problems for the app.

Another idea: Which country are you in? Have you tried changing the Region environment variable?

timoschlueter commented 1 year ago

As mentioned in issue #62 you might want do logout and re-login from the LibreLink Up app. Some people had success in a similar case.

JotaMyke commented 1 year ago

I have cardinals, numbers and letters in the password: LINK_UP_USERNAME=jotamestre@gmail.com LINK_UP_PASSWORD=#xpto123 LINK_UP_CONNECTION= LINK_UP_TIME_INTERVAL=5 LINK_UP_REGION=EU
NIGHTSCOUT_URL=xpto.sytes.net NIGHTSCOUT_API_TOKEN=12345etc NIGHTSCOUT_DISABLE_HTTPS=false
LOG_LEVEL=info
SINGLE_SHOT=false

timoschlueter commented 1 year ago

Looks good to me. Could you try the re-login in the LLU app?

JotaMyke commented 1 year ago

Yes, I saw some previous comments and I already did that

timoschlueter commented 1 year ago

The EU region setting is correct in your case?

JotaMyke commented 1 year ago

I'm doing some tests in java android studio and I log in and I get a response // private String LIBRE_LINK_UP_URL = "api-eu.libreview.io"; // String url = "https://" + LIBRE_LINK_UP_URL + "/llu/auth/login";

creepymonster commented 1 year ago

Hello,

I may be able to help a little further. I also already know this error message.

This error occurs when a login attempt has been successful, but in the response of the login is informed that (eg) new privacy policy must be accepted.

The token is therefore expired again immediately after the login.

The easiest way to fix this problem is to log out of the LibreLinkUp app and log in again. Then you usually get the latest terms and conditions displayed and can accept them.

Many greetings Reimar

PS. I will try to find an example of such a login response.

creepymonster commented 1 year ago

CleanShot 2022-12-23 at 19 27 20

Mestrias commented 1 year ago

Problem solved. Livreview.com was double authenticated. I logged in normally with email and pass and the service already receives data and makes the required uploads. Thank you very much.

bewest commented 1 year ago

@creepymonster Thanks! That solution works. It might be possible to introduce a warning message to the effect of "If this used to work, consider logging out of the mobile app, and following the prompts to log in again."