API call failing within auth callback

Hi, I am calling an API within my callback function after doing authentication with firebase. each time I call dmx.parse(“api1.load()”), it fails. This is supposed to run after authenticating a new user. I tested this same line on a button and it works. After authenticating, the page is suppose to redirect to another page. Could that be the reason it fails? The browser keeps saying that it failed to load.

var uiConfig = {
        callbacks: {
          signInSuccessWithAuthResult: function(authResult, redirectUrl) {
            var user = authResult.user;
            var credential = authResult.credential;
            var isNewUser = authResult.additionalUserInfo.isNewUser;
            var providerId = authResult.additionalUserInfo.providerId;
            var operationType = authResult.operationType;
            console.log("Begin User Signup");
            console.log("isnewuser= "+ isNewUser)
            if (isNewUser) {
              dmx.parse("api1.load()");  
 
} else {
  //  block of code to be executed if the condition is false
}
2 Likes