Replies: 1 comment 2 replies
-
Ehy @webthingz, to use a static token you should set it either via ENV variables with runtimeConfig: {
public: {
directus: {
url: "https://mydirectus.url/",
+ staticToken: "my-token",
},
},
- token: "my-token",
},
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello There,
I'm trying to figure out how to create a registration form. I have created an API user in directus for these requests with a static token. With the directus/sdk I could set a static token .with(staticToken('TOKEN') and use this with the request.
So I tried adding the token in my nuxt.config file.
and use the token in my script setup.
First of all, i'm still learning here so correct me if there are better and safer ways to do this :-)
It is very hard to find a good example/explanation how to do this also like best practice should be great to find.
When I tried to register a user I always get a 403 that I don't have permission...
So I tried to check if the script is working and when I first login with a admin user I can register a user just fine.
How can I create users with a secure and best practice in mind?
Hope somebody here can push me in the right direction :-)
Kind Regards,
Ziggy
Beta Was this translation helpful? Give feedback.
All reactions