NSLocalizedDescription=User is not authenticated, please authenticate using Firebase Authentication and try again., ResponseErrorDomain=com.google.HTTPStatus, ResponseErrorCode=401}
I am getting this error for no clear reason. My app was working perfectly fine for the past few weeks but now all of a sudden i'm getting this. I have not changed a single thing related to my login or authentication. There is something wrong with firebase. Have I reached some sort of limit?
When I try to view an image from firebase, it doesn't work anymore. And when I try to upload an image using the code below, I get an error.
static func uploadCollage(_ image: UIImage, delegate: BottomProfileViewController) {
guard let uid = Auth.auth().currentUser?.uid else {
print("error uploading image")
return
}
let refStore = Storage.storage().reference().child("collage").child(uid + ".jpg")
let imageData = UIImageJPEGRepresentation(image, 0.01)
refStore.putData(imageData!, metadata: nil) { (meta, err) in
if err != nil {
print("error uploading image data ", err ?? "")
return
}
delegate.spinner.stopAnimating()
delegate.collage.alpha = 1
print(meta ?? "no meta")
let url = String(describing: (meta?.downloadURL())!)
LoadRequests.gRef.child("Users").child(uid).child("Collage URL").setValue(url)
RequestPageViewController.userName?.info["Collage URL"] = url
}
}