mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-14 04:46:29 +00:00
Recommend ConfigEntryAuthFailed for reauthentication (#1048)
* raise ConfigEntryAuthFailed * Update config_entries_config_flow_handler.md
This commit is contained in:
parent
69615e1f0f
commit
6f0519ba66
@ -241,15 +241,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
||||
auth = api.AsyncConfigEntryAuth(...)
|
||||
try:
|
||||
await auth.refresh_tokens()
|
||||
except TokenExpiredError:
|
||||
hass.async_create_task(
|
||||
hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_REAUTH},
|
||||
data=entry.data,
|
||||
)
|
||||
)
|
||||
return False
|
||||
except TokenExpiredError as err:
|
||||
raise ConfigEntryAuthFailed(err) from err
|
||||
|
||||
# TODO: Proceed with component setup
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user