Hi Jay! Thanks for responding, and apologies for leaving you hanging.
I worked around this by just testing on Mac (Designed for iPad) and physical devices instead. But today, this happened on a physical device as well.
It crashed iPhone 11 Pro if that’s helpful. It DOES work on an iPhone 14 Pro Max, and a iPhone 13.
So let’s resolve this 
The issue happens with both SIwA and email/password auth, yes. It seems to stem from an invalid response from Atlas Auth where a HTML document is returned in place of the intended auth response.
Printing the response at that function yields this, rather than JSON.
(std::string) body = "<!DOCTYPE html>\n<html>\n <head>\n <title>App Services</title>\n <link rel=\"shortcut icon\" href=\"/static/favicon.ico\" type=\"image/x-icon\" />\n <style>\n #app { display: none; }\n </style>\n <script>\n var settings = {\"accountUIBaseUrl\":\"https://account.mongodb.com\",\"adminUrl\":\"https://realm.mongodb.com\",\"apiUrl\":\"https://realm.mongodb.com\",\"bugsnagToken\":\"d93dd442ef3db183db76cc9ded3bc109\",\"chartsUIBaseUrl\":\"https://charts.mongodb.com\",\"cloudUIBaseUrl\":\"https://cloud.mongodb.com\",\"endpointAPIUrl\":\"https://data.mongodb-api.com\",\"endpointAPIUrlsByProviderRegion\":{\"aws-ap-south-1\":\"https://ap-south-1.aws.data.mongodb-api.com\",\"aws-ap-southeast-1\":\"https://ap-southeast-1.aws.data.mongodb-api.com\",\"aws-ap-southeast-2\":\"https://ap-southeast-2.aws.data.mongodb-api.com\",\"aws-eu-central-1\":\"https://eu-central-1.aws.data.mongodb-api.com\",\"aws-eu-west-1\":\"https://eu-west-1.aws.data.mongodb-api.com\",\"aws-eu-west-2\":\"https://eu-west-2.aws.data.mongodb-api.com\",\"aws-sa-east-1\":\"https://sa-east"...
This is in response to this login code:
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
guard
let credential = authorization.credential as? ASAuthorizationAppleIDCredential,
let token = credential.identityToken,
let tokenString = String(data: token, encoding: .utf8)
else {
let alert = UIAlertController(title: "Login Error", message: "No Credential", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Dismiss", style: .cancel))
present(alert, animated: true)
return
}
Task { @MainActor in
do {
let user = try await realmApp.login(credentials: .apple(idToken: tokenString))
delegate?.loginViewControllerDidLogin(with: user, name: credential.fullName)
} catch {
print(String(describing: error))
presentError(title: "Login Error", error: error)
}
}
}
where i’ve also verified that the token looks real:
"eyJraWQiOiJXNldjT0tCIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2FwcGxlaWQuYXBwbGUuY29tIiwiYXVkIjoiY29tLmdldHdlYXJpdC53ZWFyaXQiLCJleHAiOjE2OTA1NzM4NDEsImlhdCI6MTY5MDQ4NzQ0MSwic3ViIjoiMDAwMTQ2Ljg4NTEzNGFlYzIyZjQyOTRiMWMzYTIzNTU1YzU5NTE5LjAzMzMiLCJjX2hhc2giOiIwY0QxZElMX1RnLUN0cHpzMnZiSmx3IiwiZW1haWwiOiJvc2Nhci5hcGVsYW5kQGljbG91ZC5jb20iLCJlbWFpbF92ZXJpZmllZCI6InRydWUiLCJhdXRoX3RpbWUiOjE2OTA0ODc0NDEsIm5vbmNlX3N1cHBvcnRlZCI6dHJ1ZX0.hMjobLqtaBz8bqxVqKisW4UH56mcRI6z7FhxCifwGweN23nNMIxCSyKfUBrA_m2YMZ06JWJIYK5ZTDvziD6dIHQ-l-WLnhcPef715RUGzad-sSGhIvE4-_9V-rDoWYYnmZq2UfC9VCfBDIaeJCP_rFw4oNHu2E37sm5I7VS1u1zp110RkAKYp8ezL2UktB0NkBYAzjRw3czqvZSi9HJLhrNXHSNd2OQSMUfHdELhq9touZEvvs0Km6wL9zF3P4rjTknVP0tsp-tkS890NDeAYeV6nCJADCA3U2sfJrp8qMseAaqJwKtFAG-daLoFX2QdBZbb14gQEcGXsFBF54yMNw"
I’m on the latest version of Realm.