Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

classes could be created without a "creator" #64

Closed
JumanaFM opened this issue Jan 4, 2021 · 4 comments · Fixed by #78
Closed

classes could be created without a "creator" #64

JumanaFM opened this issue Jan 4, 2021 · 4 comments · Fixed by #78
Labels
bug Something isn't working
Milestone

Comments

@JumanaFM
Copy link
Member

JumanaFM commented Jan 4, 2021

to reproduce error:

  • clear cookies but remain on the main dashboard.
  • create a class after your cookies were cleared.
  • the class will be added to the DB with "null" as the "creator" value.
  • class will not be loaded to the UI.

this is a problem also for people who leave their tabs open but have their session cleared, we shouldn't allow requests without any authentication which is also a problem with other parts in the system that needs to be handled.

@JumanaFM JumanaFM added the bug Something isn't working label Jan 4, 2021
@JumanaFM JumanaFM added this to the MVP milestone Jan 4, 2021
@karger
Copy link
Member

karger commented Jan 4, 2021 via email

@JumanaFM
Copy link
Member Author

JumanaFM commented Jan 4, 2021

I agree. I noticed this bug when Marc pointed out he wasn't able to see one of his classes in his list. The original implementation of nb doesn't always check the current user (authenticated or not).

@karger
Copy link
Member

karger commented Jan 4, 2021 via email

@JumanaFM
Copy link
Member Author

JumanaFM commented Jan 4, 2021

On 1/4/2021 5:28 PM, Jumana Almahmoud wrote: I agree. I noticed this bug when Marc pointed out he wasn't able to see one of his classes in his list. The original implementation of nb doesn't always check the current user (authenticated or not).
I would assume this checking would happen on all api calls by default---how does it fail to happen?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <#64 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIWSXQS2PTJ4EDTLKRFVV3SYI6JLANCNFSM4VTQ3T4A.

from what I have seen in the code, once the UI is loaded, it will send an api/user/current request to check if the user has a valid session, if not it will redirect to the log in page. So, as long as the page is loaded and a user was authenticated, all other requests (i believe so) assumes that a user have a valid session, which i think is not a good approach. We need to check before every action. No just for this issue but to mitigate any other anonymous requests (from postman for example and so on). I'm thinking of solving this by creating a middleware that intercepts all requests to check if they were valid.

@JumanaFM JumanaFM linked a pull request Jan 26, 2021 that will close this issue
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants