Delubear / GlucoseTray

Tray Icon for displaying current BG information in taskbar.
MIT License
35 stars 21 forks source link

Invalid Nightscout url - Error : Unauthorized #55

Open warmbo opened 3 years ago

warmbo commented 3 years ago

Describe the bug First run of the app, using Nightscout as the Datasource. Using a generated access token with admin rights.

"Settings are not valid. Please fix before continuing. Invalid Nightscout url - Error : Unauthorized"

To Reproduce Steps to reproduce the behavior:

  1. Go to GlucoseTrayCore.exe and enter in the URL and Token for Nightscout.
  2. Click on Save
  3. Error dialog appears with the error in the title.

Expected behavior The token should be accepted and 'authorization' allowed.

Desktop (please complete the following information):

Additional context I'm not sure what I might be doing wrong. I am fully selfhosting Nightscout and not using Heroku or anything outside of my own local network server.

sgmoore commented 3 years ago

Could you try the previous release (and with that version make sure you enter the URL without a trailing backspace).

If that works, there may be a problem with the latest patch I submitted.

warmbo commented 3 years ago

The previous release did indeed work right away.

warmbo commented 3 years ago

Actually, this time the app allows me to continue past the settings window, but nothing ever appears in the task tray and I cannot find it running in Task Manager still.

sgmoore commented 3 years ago

Apologies. The first error you were getting was my fault and it appears that my nightscout website was not setup to require any accesstoken, so I did not spot the error.

As to why the previous revision does not work, I'm not sure, but it might behave that way if there is something wrong with the URL. Could try enabling Debug Mode to see if that displays anything.

Bard09 commented 1 year ago

I don't know if this is relevant, but I was getting a similar error after I migrated my Nightscout instance from Heroku to Google Cloud.

I was able to resolve it by switching my AUTH_DEFAULT_ROLES configuration variable from "denied" (default with the Google Cloud Nightscout setup-- it was not defined on my previous Heroku setup) to "readable". This is obviously less-secure since my data is openly accessible, but I wasn't able to get GlucoseTray to work with the "status-only" AUTH_DEFAULT_ROLES option (that requires an authorization token).

Just sharing my workaround for others and/or the developer :)