-
Notifications
You must be signed in to change notification settings - Fork 795
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
Bug: HTTP CREATE not working when using TOKEN auth #4058
Comments
Hi @gander! Thank you for reporting this issue as well as surrealdb/docs.surrealdb.com#543, which I will address separately. Specially, thank you for providing a sandbox to help with reproducing this issue. Can you share the output of |
Looking at the code, I may have found the reason for your issue. All claims that are expected by SurrealDB accept the namespace prefix and are mapped to their original name, so Thank you again for your detailed report! |
@gguillemas This makes the implementation fully working:
|
@gguillemas you will still use my working example because I wanted to continue working. |
If you are asking whether or not the provided implementation will work after the fix is merged, the answer would be no, since the prefix will be stripped and you will be able to use the "correct" way of accessing the namespaced claims:
On second thought, I will update the PR to also include the claim with the full namespace prefix to keep backward compatibility on 1.X and port the fix without that only to 2.X. In this way, your current code will continue working. Let me know if I did not correctly understand what you meant. TL;DR: I will try to keep backward compatibility. You can assume that the code you shared will continue working unless I am unable to make it so. Check on #4061 for updates! |
I can confirm that I have been able to keep backward compatibility and your code will still work in |
@gguillemas No, I wanted to continue working on my application as it works, i.e. with a prefix. I'm wondering if you'll need a preview of this application for anything else? The application is a Proof of Concept and Work in Progress |
Correct, you can continue relying on your working code, we do not want to break the current behavior until 2.0 👍 |
I have changed this from a bug to a feature. The current behavior to access namespaced claims has been documented in surrealdb/docs.surrealdb.com#557. There are certainly improvements that can be made on how SurrealDB deals with namespaced claims, including allowing the user to set the namespace prefix and exposing its "reserved" claims (e.g. To answer your question again, we plan on the behavior remaining the same (or compatible) for the foreseeable future. Thank you for opening this issue, it has helped us review how we deal with namespaced claims and identify some improvements! |
I will close this issue and keep the original surrealdb/docs.surrealdb.com#543 until it is resolved. |
Describe the bug
Even though I successfully complete the token authorization and send a request to create a user, the record is not created.
Steps to reproduce
Follow instructions of:
Working example: https://surrealdb-auth0-examples.pages.dev/
Expected behaviour
Create and return user record.
SurrealDB version
1.5.0 for linux amd64
Contact Details
adam.gasowski@gander.pl
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: