From faf60320dda6f08cbb2db5b4b8754de812ce6580 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 19 Dec 2016 15:02:36 +0100 Subject: [PATCH 1/4] Further highlight token info in log output add critical-level log statement at the end of startup with token info --- notebook/notebookapp.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 783737b5af..39962634d0 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1321,7 +1321,15 @@ def start(self): b = lambda : browser.open(url_path_join(self.connection_url, uri), new=2) threading.Thread(target=b).start() - + + if self.token: + self.log.critical('\n'.join([ + '\n', + 'Copy/paste this URL into your browser when you connect for the first time,', + 'to login with a token:', + ' %s' % url_concat(self.connection_url, {'token': self.token}), + ])) + self.io_loop = ioloop.IOLoop.current() if sys.platform.startswith('win'): # add no-op to wake every 5s From 65cb6cc1859e545404dcac347d6bfcd2947b6295 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 20 Dec 2016 15:28:16 +0100 Subject: [PATCH 2/4] Only show token info if tokens are available on login page --- notebook/templates/login.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/notebook/templates/login.html b/notebook/templates/login.html index 1cf0a3fad1..19a38418c8 100644 --- a/notebook/templates/login.html +++ b/notebook/templates/login.html @@ -20,7 +20,7 @@ {% endblock token_message %} {% endif %}