Skip to content

User registration returns Error 400 "Bad Request" when email confirmation is ON #8600

@Elfoslav

Description

@Elfoslav

Bug report

Describe the bug

User registration returns Error 400 "Bad Request" when email confirmation is ON. User is created, but email is not sent.

Steps to reproduce the behavior

In Strapi Admin

  1. Go to 'Settings' then "Advanced Settings"
  2. Click on 'Enable Email Confirmation'
  3. In bash send POST request via curl: curl -X POST -d "password=asdfasdf&email=jogin111@jqjlb.com" http://localhost:1337/auth/local/register
  4. See the error: {"statusCode":400,"error":"Bad Request","message":{},"data":{}}

Expected behavior

Expected created user with given credentials and successfully sent registration e-mail.

System

  • Node.js version: v15.1.0
  • NPM version: 7.0.8
  • Strapi version: 3.2.5
  • Database: MongoDB
  • Operating system: OS X 10.14.6

Additional context

Similar issue: #2425

Password reset works.

Config/plugins.js:

module.exports = ({ env }) => ({
  email: {
    provider: 'sendgrid',
    providerOptions: {
      apiKey: env('SENDGRID_API_KEY'),
    },
    settings: {
      defaultFrom: 'verified_sendgrid_email',
      defaultReplyTo: 'verified_sendgrid_email',
    },
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions