More trial and error

This commit is contained in:
Micke Nordin 2024-01-16 14:15:45 +01:00
parent 19c3d41dd9
commit d7664c3c44
Signed by untrusted user: Micke
GPG key ID: F53C4CC83EDAB3BE

View file

@ -173,15 +173,14 @@ hub:
class RefreshHandler(HubAuthenticated, RequestHandler): class RefreshHandler(HubAuthenticated, RequestHandler):
@authenticated @authenticated
def get(self): def get(self):
print(os.environ)
user_model = self.get_current_user() user_model = self.get_current_user()
user_model = os.environ
self.set_header('content-type', 'application/json') self.set_header('content-type', 'application/json')
self.write(json.dumps(user_model, indent=1, sort_keys=True)) self.write(json.dumps(user_model, indent=1, sort_keys=True))
def main(): def main():
print(os.environ) prefix = '/services/refresh-token/'
prefix = os.environ.get('JUPYTERHUB_SERVICE_PREFIX', '/')
app = Application( app = Application(
[ [
(prefix, RefreshHandler), (prefix, RefreshHandler),
@ -190,6 +189,7 @@ hub:
) )
http_server = HTTPServer(app) http_server = HTTPServer(app)
print(os.environ)
url = urlparse(os.environ['JUPYTERHUB_SERVICE_URL']) url = urlparse(os.environ['JUPYTERHUB_SERVICE_URL'])
http_server.listen(url.port, url.hostname) http_server.listen(url.port, url.hostname)