Skip to content

Commit bc7fcfc

Browse files
committed
Update error message for InvalidHostingLinkDomainError
1 parent 3b1a8db commit bc7fcfc

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

firebase_admin/_auth_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,14 @@ def __init__(self, message, cause, http_response):
329329

330330

331331
class InvalidHostingLinkDomainError(exceptions.InvalidArgumentError):
332-
"""Hosting link domain in ActionCodeSettings is not authorized."""
332+
"""The provided hosting link domain is not configured in Firebase Hosting
333+
or is not owned by the current project."""
333334

334-
default_message = 'Hosting link domain specified in ActionCodeSettings is not authorized'
335+
default_message = ('The provided hosting link domain is not configured in Firebase '
336+
'Hosting or is not owned by the current project.')
335337

336-
def __init__(self, message, cause, http_response):
337-
exceptions.InvalidArgumentError.__init__(self, message, cause, http_response)
338+
def __init__(self, message, cause, http_response):
339+
exceptions.InvalidArgumentError.__init__(self, message, cause, http_response)
338340

339341

340342
class InvalidIdTokenError(exceptions.InvalidArgumentError):

tests/test_user_mgt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,9 @@ def test_invalid_hosting_link(self, user_mgt_app, func):
15111511
with pytest.raises(auth.InvalidHostingLinkDomainError) as excinfo:
15121512
func('[email protected]', MOCK_ACTION_CODE_SETTINGS, app=user_mgt_app)
15131513
assert isinstance(excinfo.value, exceptions.InvalidArgumentError)
1514-
assert str(excinfo.value) == ('Hosting link domain specified in ActionCodeSettings is '
1515-
'not authorized (INVALID_HOSTING_LINK_DOMAIN). Because '
1516-
'of this reason.')
1514+
assert str(excinfo.value) == ('The provided hosting link domain is not configured in '
1515+
'Firebase Hosting or is not owned by the current project. '
1516+
'(INVALID_HOSTING_LINK_DOMAIN). Because of this reason.')
15171517
assert excinfo.value.http_response is not None
15181518
assert excinfo.value.cause is not None
15191519

0 commit comments

Comments
 (0)