llaske / sugarizer-server

Sugarizer Server allow deployment of Sugarizer on a local server, for example on a school server.
Apache License 2.0
44 stars 94 forks source link

error while toggling favourite in admin dashboard/activities #322

Closed saga0p closed 1 year ago

saga0p commented 2 years ago

401 unauthorized error poping when clicked on the star icon to favorite an activity in dashboard/activites. POST http://localhost:8080/api/v1/activities?x_key=623a00c1a8337755841ca9c9&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXJ0aWFsIjpmYWxzZSwiZXhwIjoxNjQ5MDY5NTIwNjU2fQ.27gSOvzBRIGPA0x_hPkPdyBTATj-ZG1t4WRsftF8Ypc 401 (Unauthorized) And because of that, the toggle favorite is not getting saved

NikhilM98 commented 2 years ago

Oh, that looks like a bug. Would you like to work on this issue?

It might be associated with conditional role based authorization.

saga0p commented 2 years ago

Yes sir, I want to work on this

saga0p commented 2 years ago

while I was working on this issue. I came across a few things which is a little strange for me. The route for this is http://localhost:8080/api/v1/activities and the function which is being called is updateActivities for the activities controller. But I noticed that the function is not getting hit as I've made several console logs in it which is also not visible. Also I tried commenting out the route http://localhost:8080/api/v1/activities and tried to run the code then also it is showing the same 401 unauthorized error as I was expecting a route not found error. More to this the activities.ejs file is calling a updateActivities function which is located in the main.js file. I want to know if all are facing the 401 unauthorized error while on the admin dashboard using the favourite button to favorite activities and reordering the activities or is it just with my system. @NikhilM98 @llaske

llaske commented 2 years ago

I can't reproduce the issue on my side, could you detail your environment?

llaske commented 1 year ago

Closed due to lack of activity.