Fix client ID lookup for official apps (#36131)

This commit is contained in:
Paulus Schoutsen 2020-05-25 12:39:24 -07:00 committed by GitHub
parent 4313d4b26b
commit ba120d4220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -33,8 +33,8 @@ async def verify_redirect_uri(hass, client_id, redirect_uri):
# Whitelist the iOS and Android callbacks so that people can link apps # Whitelist the iOS and Android callbacks so that people can link apps
# without being connected to the internet. # without being connected to the internet.
if redirect_uri == "homeassistant://auth-callback" and client_id in ( if redirect_uri == "homeassistant://auth-callback" and client_id in (
"https://www.home-assistant.io/android", "https://home-assistant.io/android",
"https://www.home-assistant.io/iOS", "https://home-assistant.io/iOS",
): ):
return True return True

View file

@ -166,8 +166,7 @@ async def test_find_link_tag_max_size(hass, mock_session):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"client_id", "client_id", ["https://home-assistant.io/android", "https://home-assistant.io/iOS"],
["https://www.home-assistant.io/android", "https://www.home-assistant.io/iOS"],
) )
async def test_verify_redirect_uri_android_ios(client_id): async def test_verify_redirect_uri_android_ios(client_id):
"""Test that we verify redirect uri correctly for Android/iOS.""" """Test that we verify redirect uri correctly for Android/iOS."""