I’m trying to log in to a 3rd party service and am getting an error that says, “Cannot find base64.” Is there an alternative to installing the crypto-js library?
import {fetch} from ‘wix-fetch’;
let url = ‘https://services.onetcenter.org/ws/’;
let username = ‘user’;
let password = ‘passwd’;
let headers = {
‘Authorization’: 'Basic ’ + base64.encode(username + “:” + password)
};
let options = {
method:‘POST’,
headers: headers
}
fetch(url, options)
.then((httpResponse) => {
// Add code to check the response
})