diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 317fef43..b996760c 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -111,6 +111,15 @@ if __name__ == '__main__': # noqa: C901 if args.force_localserver_for_auth: config.set_auth_force_localserver() + if args.force_edmc_protocol: + if sys.platform == 'win32': + config.set_auth_force_edmc_protocol() + + else: + print("--force-edmc-protocol is only valid on Windows") + parser.print_help() + exit(1) + def handle_edmc_callback_or_foregrounding() -> None: # noqa: CCR001 """Handle any edmc:// auth callback, else foreground existing window.""" logger.trace('Begin...') diff --git a/config.py b/config.py index b78b2c34..6889ee2f 100644 --- a/config.py +++ b/config.py @@ -182,6 +182,7 @@ class AbstractConfig(abc.ABC): __in_shutdown = False # Is the application currently shutting down ? __auth_force_localserver = False # Should we use localhost for auth callback ? + __auth_force_edmc_protocol = False # Should we force edmc:// protocol ? def __init__(self) -> None: self.home_path = pathlib.Path.home() @@ -212,6 +213,19 @@ class AbstractConfig(abc.ABC): """ return self.__auth_force_localserver + def set_auth_force_edmc_protocol(self): + """Set flag to force use of localhost web server for Frontier Auth callback.""" + self.__auth_force_edmc_protocol = True + + @property + def auth_force_edmc_protocol(self) -> bool: + """ + Determine if use of localhost is forced for Frontier Auth callback. + + :return: bool - True if we should use localhost web server. + """ + return self.__auth_force_edmc_protocol + @property def app_dir(self) -> str: """Return a string version of app_dir."""