home-assistant / home-assistant/iOS

Unable to re-authenticate after Home Assistant reinstall – app stuck on “Retry now” on iPhone and iPad

Open
#5,346 15 comments 0 reactions 0 assignees View on GitHub
bug ios
Dominant language
Swift
Stars
2.4k
Forks
520
Avg merge
7h 27m
Merged PRs (30d)
264

Description

Image

iOS device model, OS version, and app version

Device 1

* iPhone 17 Pro Max
* iOS 26.5.2
* Home Assistant Companion App 2026.7.2, build 2026.2446

Device 2

* iPad Pro 11-inch, 4th generation
* iPadOS 26.6
* Home Assistant Companion App 2026.7.2, build 2026.2446

Home Assistant Core version

Home Assistant Core 2026.7.4
Home Assistant OS 18.2
Supervisor 2026.07.5

Describe the bug

Home Assistant was completely reinstalled on the same Raspberry Pi.

Both the iPhone and iPad Companion Apps were previously connected to the old Home Assistant installation. After the new installation, both apps are permanently stuck on:

Unable to connect to Home Assistant
Retrying in 60 seconds

The error screen only provides the button “Retry now”. There is no troubleshooting button, settings button, server selection, logout, or re-authentication option.

The apps appear to keep using refresh tokens from the previous Home Assistant installation. The new Home Assistant server rejects these tokens, but the Companion Apps do not start a new authentication flow.

Home Assistant server logs

The server repeatedly records failed authentication requests from both devices.

Examples:

Requested URL: '/auth/token'
Home Assistant/2026.7.2
Alamofire/5.12.0

and:

Requested URL: '/api/websocket'
Home Assistant/2026.7.2
Mobile/HomeAssistant

The iPad is separately identified on the local network, so the issue has been reproduced independently on two Apple devices.

Steps to reproduce

1. Connect the Home Assistant Companion App to an existing Home Assistant installation.
2. Completely reinstall or rebuild Home Assistant so that the old refresh tokens are no longer valid.
3. Open the previously configured Companion App.
4. The app attempts to use the old token.
5. Home Assistant rejects the request to /auth/token.
6. The app remains permanently on the “Unable to connect” screen with only “Retry now”.
7. No re-authentication or server reset flow is offered.

Troubleshooting already performed

* Confirmed that Home Assistant is reachable through Safari on the same iPhone and iPad.
* Confirmed that login through Safari works with the new Home Assistant user account.
* Confirmed that local and external access to Home Assistant work.
* Completely deleted the Companion App from the iPhone.
* Restarted the iPhone.
* Reinstalled the Companion App.
* Updated the Companion App from 2026.7.1 to 2026.7.2.
* The issue remains unchanged.
* The same issue occurs independently on the iPad.
* The server logs confirm that both apps reach Home Assistant but submit invalid authentication credentials.

Expected behavior

When the stored refresh token is rejected, the Companion App should:

* automatically start the Home Assistant authentication flow, or
* show a re-authentication button, or
* provide a way to remove/reset the saved server configuration.

Deleting and reinstalling the app should also provide a reliable method to clear the invalid saved credentials.

Actual behavior

The app continuously retries the invalid credentials and provides no way to leave the error screen.

Impact

This prevents use of the Home Assistant Companion App on both available Apple devices.

It also blocks:

* registering the devices with the mobile_app integration,
* Home Assistant push notifications,
* importing Apple Thread credentials into Home Assistant,
* commissioning a Matter-over-Thread smoke detector.

Additional context

The Home Assistant mobile_app integration currently has no registered devices because neither Apple device can complete authentication after the Home Assistant reinstall.

The issue appears to be related to stale credentials retained in the Apple Keychain or app configuration and a re-authentication flow that is not triggered when /auth/token rejects the old refresh token.

Contributor guide

Open the contributing guide

Research direction

Reproduce the reinstall flow on an iPhone or iPad, then trace handling of rejected /auth/token refresh requests and the saved credentials described in the report. Verify that rejecting an old token can leave the “Retry now” screen and that the app provides a re-authentication or server-reset path.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.