I tried to use fetch with this syntax:
fetch(\"https://user:password@url\", { ... }).then((response) => { ... }).done();
The same url
You could have used btoa() instead of using the base_64 module. btoa() is a function on the Window.
btoa()
base_64
Window