Skip to content

Commit

Permalink
authenticate the static handler
Browse files Browse the repository at this point in the history
* Closes #231
* Provide our own static handler rather than using Jupyter Server.
* This is because we are not using the same template/static resource approach.
* We would have to edit URLs in the UI to point at `static/cylc/*`.
* Adding authentication here provides login redirection.
  • Loading branch information
oliver-sanders committed Aug 24, 2021
1 parent 72e05c5 commit 65be593
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cylc/uiserver/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ def hub_groups(self):


class CylcStaticHandler(CylcAppHandler, web.StaticFileHandler):
pass

@web.authenticated
def get(self, path):
# authenticate the static handler
# this provides us with login redirection and token cashing
return web.StaticFileHandler.get(self, path)


class UserProfileHandler(CylcAppHandler):
Expand Down

0 comments on commit 65be593

Please sign in to comment.