Hi, thanks for your reply. But this content-type it’s of the response, not the request. The request is like below:
_header: ‘POST /admin/auth/login HTTP/1.1\r\n’ +
‘Accept: application/json, text/plain, /\r\n’ +
‘Content-Type: application/json;charset=utf-8\r\n’ +
‘User-Agent: axios/0.19.2\r\n’ +
‘Content-Length: 64\r\n’ +
‘Host: localhost:1337\r\n’ +
‘Connection: close\r\n’ +
‘\r\n’,
Oh shoot your right, sorry about that. The /admin/auth/local endpoint doesn’t use identifier like the end-user /auth/local. For the admin login you need to send email and password.
Very strange, but I’d tried with paths /admin/auth/local and /auth/local, with the fields identifier or email. Without the admin prefix, the response returns “400”, but with the prefix, still return “405” =/
Hmmm, I understood. When I’m using /auth/local returns 400:
{
“statusCode”: 400,
“error”: “Bad Request”,
“message”: [
{
“messages”: [
{
“id”: “Auth.form.error.invalid”,
“message”: “Identifier or password invalid.”
}
]
}
],
}
But the identifier and password are correct, very strange.
I also get the same problem. When I use Postman for testing the all the GET requests work and the POST request works aswell, but DELETE and PUT requests return Method Not Allowed. Eventough I enabled all the permissions in Strapi. Below you can see my request and the response in Postman. Maybe you have and idea, why that could be. Thanks in advance for your help!
I want to implement custom register method where user verifies his/her mobile no. using OTP.
When i’m trying to extend plugin::users-permissions.auth controller, I followed this steps in strapi v4 documentation,
What turned out to be the problem for me is a wrong fetch URL. You can check your URLs under Settings → Roles and one of the methods such as GET, UPDATE OR DELETE. Once you select it, it provides an example of request.
This error is directly related to the lack of permissions! Solution for cases without authorization!! If you are at the stage of developing the functionality, updated the straps or deleted the cache and made a build, then you need to go to this menu and set it as shown in the photo. Also see all permissions for your role.