mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 19:57:03 -04:00
Remove redundant user check in Geocaching config flow (#193074)
This commit is contained in:
@@ -48,7 +48,7 @@ class GeocachingFlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
|
||||
session=async_get_clientsession(self.hass),
|
||||
)
|
||||
status = await api.update()
|
||||
if not status.user or not status.user.username:
|
||||
if not status.user.username:
|
||||
return self.async_abort(reason="oauth_error")
|
||||
|
||||
if existing_entry := await self.async_set_unique_id(
|
||||
|
||||
@@ -161,8 +161,8 @@ async def test_oauth_error(
|
||||
resp = await client.get(f"/auth/external/callback?code=abcd&state={state}")
|
||||
assert resp.status == HTTPStatus.OK
|
||||
|
||||
# No user information is returned from API
|
||||
mock_geocaching_config_flow.update.return_value.user = None
|
||||
# No username is returned from API
|
||||
mock_geocaching_config_flow.update.return_value.user.username = None
|
||||
|
||||
aioclient_mock.post(
|
||||
CURRENT_ENVIRONMENT_URLS["token_url"],
|
||||
|
||||
Reference in New Issue
Block a user