From 00e8e9d84a2df37f044ed296500e7d58b5e8b192 Mon Sep 17 00:00:00 2001 From: Ryan Holmes Date: Sat, 17 Mar 2018 20:18:28 -0400 Subject: [PATCH] Send pyfa version to server when logging in --- service/esi.py | 2 +- service/esi_security_proxy.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/service/esi.py b/service/esi.py index 10b4f0def..f76f288d5 100644 --- a/service/esi.py +++ b/service/esi.py @@ -198,7 +198,7 @@ class Esi(object): esisecurity = EsiSecurityProxy(sso_url=config.ESI_AUTH_PROXY) - uri = esisecurity.get_auth_uri(state=self.state, redirect='http://localhost:{}'.format(port)) + uri = esisecurity.get_auth_uri(state=self.state, redirect='http://localhost:{}'.format(port), pyfa_version=config.version) self.serverThread = threading.Thread(target=self.httpd.serve, args=(self.handleLogin,)) self.serverThread.name = "SsoCallbackServer" diff --git a/service/esi_security_proxy.py b/service/esi_security_proxy.py index 21d0f8510..7c29f80b0 100644 --- a/service/esi_security_proxy.py +++ b/service/esi_security_proxy.py @@ -12,6 +12,7 @@ import time from requests import Session from requests.utils import quote from six.moves.urllib.parse import urlparse +from urllib.parse import urlencode from esipy.events import AFTER_TOKEN_REFRESH from esipy.exceptions import APIException @@ -115,7 +116,7 @@ class EsiSecurityProxy(object): return request_params - def get_auth_uri(self, state=None, redirect='http://localhost:8080'): + def get_auth_uri(self, *args, **kwargs): """ Constructs the full auth uri and returns it. :param state: The state to pass through the auth process @@ -123,10 +124,9 @@ class EsiSecurityProxy(object): :return: the authorizationUrl with the correct parameters. """ - return '%s?redirect=%s%s' % ( + return '%s?%s' % ( self.oauth_authorize, - quote(redirect, safe=''), - '&state=%s' % state if state else '' + urlencode(kwargs) ) def get_refresh_token_params(self):