sensebox / openSenseMap

Platform for storing and exploring sensor data
https://opensensemap.org
MIT License
99 stars 51 forks source link

Can't update box #373

Open noerw opened 3 years ago

noerw commented 3 years ago

Expected Behavior

I can change properties of my box in the dashboard

Actual Behavior

The API responds to PUT /boxes/:id with "422 Unprocessable Entity":

"message": "Validation failed: Path `access_token` is required."

After making the request, I am logged out.

Environment

ubergesundheit commented 3 years ago

/cc @felixerdy @umut0

felixerdy commented 3 years ago

You can go into your settings and generate a new access_token for your senseBox

noerw commented 3 years ago

@felixerdy Thanks for the hint, thats new to me. Would be good to let users know that boxes can only be updated when setting an access_token first.

You can go into your settings and generate a new access_token for your senseBox

But I don't want to (as then I have to reflash the sensebox, and currently have no access to the physical box) ;)

Also it's weird that the managing user-account would use a box-specific access token, and failing to provide that invalidates the user account access token? Something seems fishy there

felixerdy commented 3 years ago

You are right. There is definitely still an issue that came from the usage of the access_token. We only observed that issue with boxes that had been registered some years ago that don't have an access_token yet. We still have to do the migration of old boxes in the database (i.e. adding an access_token).

Don't worry, if you just generate a new access_token, you won't need to update your box as long as you don't enable the authentication feature in the checkbox above