mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Add authentication for terminal websockets
This commit is contained in:
parent
b929b3f09e
commit
cbc70a7de7
@ -21,4 +21,8 @@ class NewTerminalHandler(IPythonHandler):
|
||||
name, _ = self.application.terminal_manager.new_named_terminal()
|
||||
self.redirect("/terminals/%s" % name, permanent=False)
|
||||
|
||||
TermSocket = terminado.TermSocket
|
||||
class TermSocket(terminado.TermSocket, IPythonHandler):
|
||||
def get(self, *args, **kwargs):
|
||||
if not self.get_current_user():
|
||||
raise web.HTTPError(403)
|
||||
return super(TermSocket, self).get(*args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user