Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

286
Visualizações
Strapi register method not allowed 405 in v4 seems url is incorrect

quite puzzled with a Strapi question. Working with v4 and hooking up a registration functionality. Invoke code is below. All other things are good i.e. function variables being submitted, etc. But when I call strapi.register I get a 405 All my roles/permissions are good:

// make request to register user with strapi
const response = await strapi.register(username, email, password);

Result: POST http://localhost:1337/auth/local/register 405 (Method Not Allowed)

When I look in the Strapi admin in the User roles and permissions, I see in the box where the register options is that the target url is: /api/auth/local/register !!!

What gives? I read that you may can do something in /config/api.js or similar, or maybe use a proxy in package.json. Can't resolve why this url is different? Is it a bug? How would you make this work. I am specultating that I need to add /api to the request somewhere. But don't know where. Thanks everyone!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You're missing the api/ part. You should change your path for :

  POST  http://localhost:1337/api/auth/local/register
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda