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

403 error when trying to access a newly created resource #392

Closed
SlimShadyIAm opened this issue May 6, 2024 · 1 comment · Fixed by #398
Closed

403 error when trying to access a newly created resource #392

SlimShadyIAm opened this issue May 6, 2024 · 1 comment · Fixed by #398
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@SlimShadyIAm
Copy link
Contributor

Problem

When you are invited to a new study and you are already signed in, and you try to accept the invitation, you will get a 403 error. This is because your token does not have the claims required to access the newly created resource.

Furthermore, when the deployment is null because the backend throws an error such as in this case, an assertion will fail in the research package. This should be handled differently - we should throw an error so the app can handle this error.

Solution

Whenever you get a 403 error, try to refresh the token manually and re-try the request. If it fails again, you really are not supposed to be able to access that request and you should somehow handle that (on the portal we redirect to the homepage and show an error snackbar that you don't have access).

@SlimShadyIAm SlimShadyIAm added the bug Something isn't working label May 6, 2024
@bardram
Copy link
Contributor

bardram commented May 6, 2024

image

@bardram bardram added the enhancement New feature or request label May 6, 2024
bardram added a commit that referenced this issue May 30, 2024
@bardram bardram linked a pull request May 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants