Redirect after registration does not work

System Information
  • Strapi Version: 4.0.8
  • Operating System: MacOS Catalina
  • Database: Postgres 14.1
  • Node Version: 14.18.3
  • NPM Version: 8.4.1
  • Yarn Version: 1.22.17

The registration process works fine as long as there is no redirect link set in “Advanced settings”. But as soon as there is a redirect link (to the root page of my Quasar localhost app at http://localhost:8080/), I get a 400 as return. The user, however, is created. Also, the test mail is sent successfully. The “shipper email” is set to the same email address that the “Test email delivery” uses (in the “Configuration” section). sendgrid is used as email provider.

This is my submit function:

function handleSubmit() {
   [...]
   return api.post('/auth/local/register', { username: state.username, email: state.email, password: state.password })
    .then(response => {
      $q.notify({
        type: 'positive',
        position: 'top',
        message: 'Registration successful!'
      })
    })
    .catch(error => {
      $q.notify({
        type: 'negative',
        position: 'top',
        message: 'Registration error: ' + error.message
      })
    })
}

// Email provider config

module.exports = ({ env }) => ({
  email: {
    config: {
      provider: 'sendgrid',
      providerOptions: {
        apiKey: env('SENDGRID_API_KEY'),
      },
      settings: {
        defaultFrom: 'myemailaddress@gmail.com',
        defaultReplyTo: 'myemailaddress@gmail.com',
        testAddress: 'myemailaddress@gmail.com',
      },
    }
  },
  'users-permissions': {
    config: {
      jwt: {
        expiresIn: '14d',
      },
    },
  },
[...]

Backend and Frontend run on localhost… Any idea what I am missing or doing wrong?

Updated to strapi v4.1.0,but error remains. This is what the terminal spits out:

[2022-02-17 18:52:23.455] error: Forbidden
ApplicationError: Forbidden
    at Object.register (/Volumes/[...]/strapi-postgres/node_modules/@strapi/plugin-users-permissions/server/controllers/auth.js:349:17)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async returnBodyMiddleware (/Volumes/[...]/strapi-postgres/node_modules/@strapi/strapi/lib/services/server/compose-endpoint.js:52:18)
    at async policiesMiddleware (/Volumes/[...]/strapi-postgres/node_modules/@strapi/strapi/lib/services/server/policy.js:24:5)
    at async /Volumes/[...]/strapi-postgres/node_modules/@strapi/strapi/lib/middlewares/body.js:24:7
    at async /Volumes/[...]/strapi-postgres/node_modules/@strapi/strapi/lib/middlewares/logger.js:22:5
    at async /Volumes/[...]/strapi-postgres/node_modules/@strapi/strapi/lib/middlewares/powered-by.js:16:5
    at async cors (/Volumes/[...]/strapi-postgres/node_modules/@koa/cors/index.js:95:16)
    at async /Volumes/[...]/strapi-postgres/node_modules/@strapi/strapi/lib/middlewares/errors.js:13:7

Any ideas?