score:1

Accepted answer

after skimming through the provided frontend tutorial, i think i can narrow the problem down to the component authservice. it has a method named register:

  register(username, email, password) {
    return axios.post(api_url + "signup", {
      username,
      email,
      password
    });
  }

because currently you never send a role when the user registers. so new users always end up with the default role. if you would want to give the user another role than the default one at registration, you would have to add the parameter roles to the config object in the axios.post function. for example like this:

  register(username, email, password) {
    return axios.post(api_url + "signup", {
      username,
      email,
      password,
      roles=[ "role_admin" ]
    });
  }

so you could create another signup page where you use this modified register function instead of the default one.


Related Query

More Query from same tag