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
Token authentication fails with @directus/sdk (auth.static method only) #12644
Comments
It seems the proper way to authenticate with token is through constructor, // This work using options from constructor
sdk = new Directus(config.url, {
auth: {
staticToken: config.token
}
}) |
Granted I haven't look into this yet, but I'm pretty sure it's not expected. Could be linked to #12399. Out of curiosity and this question may end up not being relevant at all, are you running the script server side or client side? |
I'm running this in NodeJS v16. |
I tested this locally but it seems to work (without using constructor etc): Code_4DTdse7yWO.mp4Are you able to reproduce this reliably even with a fresh Directus instance? or is this only happening to your specific instance? |
Oh and would you mind sharing the There is a possibility that it is related to a recent filter issue since I can't seem to reproduce it, but my test is without the filter in your code 🤔 |
I'm seeing the same behavior as @azrikahar on my end, so I'll close this for now. Happy to keep discussing/debugging tho! |
Describe the Bug
I just upgrade to lastest directus server and @directus/sdk library, but token authentication fails to authenticate properly when using
auth.static(token)
method.To Reproduce
Configure a token on a user, and run this script.
Errors Shown
You don't have permission to access this.
What version of Directus are you using?
v9.8.0
What version of Node.js are you using?
v16.14.2
What database are you using?
PostgreSQL 13
What browser are you using?
Chrome
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: