Creating a user with password using GraphQL endpoints

I am working on a user management system for an internal admin app. I created a custom form to create users using userSignUpWithPassword. When I attempt the request I get an error => Sign up with password cannot be used, when authorization is specified.

I’ve tried to remove the authorization header using the following method:

const context = { headers: { authorization: '' } };
const [userSignUpWithPassword] = useMutation(CREATE_USER, { context });

But I still get the same error. Seems the 8base provider still appends the header anyways.

Is there a way to prevent this or is there an alternate approach I should be taking to achieve this?

I ran into this same issue when trying with the API-explorer.

I’m not using the 8base provider myself. But using react-apollo works fine client-side for me. (it was just the API-explorer that force-adds the header with no way of removing it)

Not sure if the 8base provider does the same.

Hey @HackAfro!

You’re still specifying the authorization header in this example :slight_smile:

The request is receiving the following header string:

  -H "Authorization: Bearer "

Even though you omitted the token value.

Try sending the same request and simple make sure that no authorization header is specified and everything should work fine.

Hello @sebastian.scholl I tried the approach of leaving out the authorization header totally but it somehow still gets appended when the request is made.

My question is, does the 8base provider append the header to outgoing requests? If it does, how do I exempt this particular request?

Hey @vorobeez do you know about this?

@HackAfro 8base provider appends the header, that’s right. And for now you can’t avoid this functionality.

But why do you want to call userSignUpWithPassword on admin’s side? It’s intended to use in custom signup forms.