title: Firebase Error:The photoURL field must be a valid URL
body: <p>I am uploading images to firebase storage and would like to save their images as the photoURL in Firebase authentication. However when I go to upload the image URL after using get signed URL I receive the error </p>
  
  <blockquote>
    <p>Error: The photoURL field must be a valid URL.</p>
  </blockquote>
  
  <p>I know that the URL is valid as I have checked it from the console out put. I have tried using <a href="https://stackoverflow.com/questions/45333246/firebase-downloadurl-invalid-url">decodeURI</a> and even gone so far as to look into the source code for the <code>firebase-admin-node</code> tracking all the way down to a file called  <a href="https://github.com/firebase/firebase-admin-node/blob/6c7c326e2c60bc06dcfa6a9fade4b187e21cdb9b/src/auth/auth-api-request.ts" rel="nofollow noreferrer">auth-api-requests.ts</a> which on line 252 checks the URL in a function named <code>validator.isURL(request.photoUrl)</code> this led me to the file where the function is defined <a href="https://github.com/firebase/firebase-admin-node/blob/6c7c326e2c60bc06dcfa6a9fade4b187e21cdb9b/src/utils/validator.ts" rel="nofollow noreferrer">validator.ts</a> which defines <code>.isURL()</code> on line 152 in this function checks are performed against a string of forbidden characters. I dont want to tamper with the Firebase source code, but I am unable to find any solution. There should be an easier solution for the return from one google function <code>.getSignedURL()</code> to be used as a parameter in another <code>.updateUser({photoURL:</code>}) especially considering that one can no longer call on <code>firebase.getDownloadURL()</code> from the google cloud functions node. Thank you for any assistance you provide in solving this.</p>
  
  <pre><code>    var downloadURL = "";
     await admin.storage().bucket("gs://****firebase.appspot.com").file(storageRef).getSignedUrl({"action":"read","expires":Date.now() + 500*365*24*3600000}).then((value) =&gt; {
          console.log("value after requesting signed URL: " + JSON.stringify(value));
          downloadURL = value;
          return value;
      }).catch((error) =&gt; {
          console.log("error perfoming signed URL: " + error);
          return error;
      })
  
  
      const url = decodeURI(downloadURL)
      console.log("\nThe decodeURI url: " + url + "\n");
  
      await admin.auth().updateUser(userID,{photoURL:url}).then((user) =&gt; {
          console.log("User update ran a success: " + JSON.stringify(user));
          return true;
      }).catch((error) =&gt; {
          console.log("An error occured in getting the user: " + error);
          return error;
      });
  </code></pre>