Unable to access user token in Directus

Viewed 2866

I am trying to get directus user token. For this purpose I am using Postman. But when I send a POST request to the api with user login credentials. I get this error:

We're sorry but Directus doesn't work without JavaScript enabled. Please enable it to continue.

I want to access the (user token). Is there any alternative way to get user token in Directus CMS. Any help will be appreciated.

Thank you.

2 Answers

We're sorry but Directus doesn't work without JavaScript enabled. Please enable it to continue.

If you're seeing the above error, I would imagine you're sending a post request to the Javascript frontend and not the API.

I would expect you to send a request to something like: https://demo-api.directus.app/_/auth/authenticate

With post JSON body like: { "email" : "admin@example.com", "password" : "password" }

Docs: https://docs.directus.io/api/reference.html#get-auth-token

Related