Skip to content

Commit

Permalink
removed unused endpoint + fixed invalid auth check for disabled auth
Browse files Browse the repository at this point in the history
  • Loading branch information
bugy committed Jan 26, 2019
1 parent ea500e8 commit 1eee6a2
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/web/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def get(self):
auth = self.application.auth

username = None
if auth.is_enabled:
if auth.is_enabled():
username = auth.get_username(self)

info = {
Expand Down Expand Up @@ -608,17 +608,6 @@ def post(self):
auth.logout(self)


class GetUsernameHandler(BaseRequestHandler):
@check_authorization
def get(self):
auth = self.application.auth
if not auth.is_enabled():
raise tornado.web.HTTPError(404)

username = auth.get_username(self)
self.write(username)


class DownloadResultFile(AuthorizedStaticFileHandler):
def set_extra_headers(self, path):
super().set_extra_headers(path)
Expand Down Expand Up @@ -839,8 +828,6 @@ def init(server_config: ServerConfig,
handlers.append((r'/auth/config', AuthConfigHandler))
handlers.append((r'/logout', LogoutHandler))

handlers.append((r"/username", GetUsernameHandler))

handlers.append((r"/(.*)", AuthorizedStaticFileHandler, {"path": "web"}))

settings = {
Expand Down

0 comments on commit 1eee6a2

Please sign in to comment.