Super!, that made the code work perfectly. Many thanks for the help!.
Sorry, the response error message is this one:
Access to fetch at 'https://rest.xxxxxxxx.com/wp-json/api-bearer-auth/v1/login' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.