We are using our API as a data source. GET works perfectly and for the Editor - so does the update using POST.
But - for regular users, we get status = 500 when using POST.
Looking into the logs of our server, it returns 200, but UIBakery server returns 500
Hey @eran!
It’s difficult to guess the issue based on the few informations you gave here. Maybe try to elaborate on certain aspects of your question, like what do you mean with regular users
? Is it just the same user but not in editing mode, or is it a user with a certain role or is it anonymous user access?
Already with that information there are some things you can check:
- If you mean anonymous user access, try to check for this option in the data source settings:
- If you mean a user with some user role, check the role settings:
- Generally you can check if you set anything here
Something else you can try (if you didn’t do that already), is to make a very simple API call (just a request exchange or something) and check if that works and work from there. But as I said, if you want help you should describe the whole situation better.
- The problem happens when the user’s role is a user. For editors it works fine.
- Anonymous access is set to Allow
- Users are allowed to use the data source, editors also to manage it
- GET works properly
Note again that in our app (the datasource) we see status 200 but UIBakery returns 500
Hello @eran
Let us check into this case. Could you please ensure regular users have the necessary permissions to perform POST requests? Please check role-based access control (RBAC) in your API and let me know if this is set up correctly.
Thank you!
Note again - the POST API succeeds, our system is updated and it returns status 200. But, in the UI we get a failure with status 500.
We do have an internal access control but it is not part of the problem
One more, maybe important piece of information.
- When a user invokes UIBakery, we prompt him / her with login to our system.
- We call a login POST request and store the returned data (token). This works fine
- When trying to submit data, we add the token to the request header. The POST data and token get correctly to our app, returning status 200
- UIBakery overrides this return code
Thanks for the help
To get it straight:
- request is received on API
- request is processed by API
- API sends 200 response
- UI Bakery receives response, but shows HTTP error 500 in action
Does this also mean the action fails? Just asking because I have an action on one of my pages that on page load always shows an error popup but the action itself succeeds.
Also, do the action logs reflect this HTTP error?
I would’ve considered the authentification token a possible issue, but if the editor roles don’t encounter the issue with the same methods that cant be it.
Hi,
If you receive both the token and the body on the endpoint and it returns 200, it could be something from the Return 200 encoding.
You can try showing the data you send in the request in uiBakery and try the same request in postman to see what code appears
Trying again this morning…
We suspect that it relates to the returned token and length of cookies and how UIBakery stores them.
We will try to validate / fix this issue. Meanwhile - thanks for your help