diff options
-rw-r--r-- | qvisqve/auth_router.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/qvisqve/auth_router.py b/qvisqve/auth_router.py index d4f3ca6..4e4bec1 100644 --- a/qvisqve/auth_router.py +++ b/qvisqve/auth_router.py @@ -22,9 +22,9 @@ import qvisqve class AuthRouter(qvisqve.Router): - def __init__(self, callback_url): + def __init__(self, apps): super().__init__() - self._callback_url = callback_url + self._apps = apps def get_routes(self): return [ @@ -37,6 +37,10 @@ class AuthRouter(qvisqve.Router): ] def _auth(self, content_type, body, *args, **kwargs): + qvisqve.log.log( + 'xxx', msg_text='_auth called', content_type=content_type, + body=body, args=args, kwargs=kwargs) + if content_type != 'application/x-www-form-urlencoded': return qvisqve.bad_request_response('Wrong content type') @@ -45,7 +49,11 @@ class AuthRouter(qvisqve.Router): # - create and store auth code # - use callback url provided in request + callback_url = self._apps.get('facade') # FIXME get real app name + params = urllib.parse.urlencode({'code': 123}) - url = '{}?{}'.format(self._callback_url, params) + url = '{}?{}'.format(callback_url, params) + + qvisqve.log.log('xxx', msg_text='Returning redirect', url=url) return qvisqve.found_response('Redirect to callback url', url) |