ethanopp / fitly

Self hosted web analytics for endurance athletes
MIT License
184 stars 24 forks source link

Peloton Credentials Required? (error 401 on pelotonApi.get_class_type) #7

Closed pierretamisier closed 4 years ago

pierretamisier commented 4 years ago

Are the peloton credentials required to use all the features of the app? Either way, for some reason, the below exception in pelotonApi._create_api_session(cls) is never raised. I don't have any login/pwd for peloton in the config.

if cls.peloton_username is None or cls.peloton_password is None:
            raise PelotonClientError("The Peloton Client Library requires a `username` and `password` be set in "
                                     "`/.config/peloton, under section `peloton`")

Not sure how the "is None" is supposed to work but print(cls.peloton_username) outputs 2 spaces.

This leads to receiving an error 401 when making the API call for pelotonApi.get_class_types.

image

ethanopp commented 4 years ago

Peloton is not a requirement - try this commit https://github.com/ethanopp/fitly/commit/2a25df2f3c7a7cfeccacda4ac3220c2c71ab7c22

pierretamisier commented 4 years ago

Did a quick git pull but still the same issue. I'll keep investigating tomo.

ethanopp commented 4 years ago

Sorry missed a line... this should do it: https://github.com/ethanopp/fitly/commit/df814662b565c5805f21fe1b9eff71a6b5c2f40e

pierretamisier commented 4 years ago

This commit worked thanks! The pelotonClientError doesn't get displayed anymore when loading up the app.