Companion App stuck in endless login loop – only on my personal iPhone

Hi everyone,

I recently set up remote access to my Home Assistant instance using a Cloudflare Tunnel, and it’s working fine overall. I can access it externally from any web browser — Safari, Chrome, no issues — and it also works fine when I open it in a mobile browser.

The problem is with the Home Assistant Companion App. When I try to use it, I get stuck in a permanent login loop, and I’m also not able to change/edit the server URL within the app.

Interestingly, when I try this on a different iPhone, it works without any issues. It’s only my personal iPhone that has this problem.

Things I’ve already tried:

  • Clearing the iPhone’s cache
  • Uninstalling and reinstalling the Companion App

Nothing has worked so far. I’m honestly out of ideas at this point — is there some kind of local config/cache file I need to reset or delete? I just don’t know how to force the app to regenerate that.

Since it works fine on another iPhone with the same network and same Home Assistant setup, it really seems like it must be something specific to my device.

I’ve attached a screenshot for reference. Would really appreciate any help — thanks a lot in advance!

Set your phone your to airplane mode which should then force it to fully error out and present the settings menu again. From there I would just delete the server profile and re-add it.

This worked for me with a similar issue.

Similar issue here with a second iPhone that uses a separate non-admin user account. The permanent failing login loop despite that server settings and login credentials are correct. The trick with the Airplane Mode (thanks!) to get to the app setting worked once, and then it did not a second time, which was weird.
Interestingly I get many error logs on HA: “Login attempt or request with invalid authentication from iPhone.lan…” These are for Requested URL: ‘/api/websocket’., Requested URL: ‘/api/states’., Requested URL: ‘/auth/token’.

Also have reinstalled the companion app twice for a fresh start but to no avail. On my main iPhone where I login with admin-credentials, the non-admin account failed too at first but deleting and recreating the user then made it work. But this account then still failed again on the 2nd iPhone.

So somehow the authentication fails for -to me- unknown reasons. Anybody has a tip? Thanks. I don’t have the time right now to research this deeper.