Add an error message when authentication fails

This commit is contained in:
Matt
2022-09-18 08:49:06 -04:00
parent 50a43e8e01
commit bd1917a8a7
2 changed files with 10 additions and 0 deletions

View File

@@ -1104,3 +1104,7 @@ msgstr "Login using Quick Connect"
msgctxt "#30445"
msgid "Continue Watching"
msgstr "Continue Watching"
msgctxt "#30446"
msgid "There was an error logging in"
msgstr "There was an error logging in"

View File

@@ -260,6 +260,12 @@ def check_server(force=False, change_user=False, notify=False):
auth_payload = {'username': selected_user_name, 'pw': password}
auth = api.authenticate(auth_payload)
if not auth:
# Login failed, we don't want to change anything
something_changed = False
log.info('There was an error logging in with user {}'.format(selected_user_name))
xbmcgui.Dialog().ok(__addon_name__, translate_string(30446))
if something_changed:
home_window = HomeWindow()