mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 07:23:00 +00:00
Merge pull request #2670 from GeorgianaElena/redirect_admin_to_login
/hub/admin redirect to login
This commit is contained in:
@@ -349,6 +349,7 @@ class SpawnPendingHandler(BaseHandler):
|
||||
class AdminHandler(BaseHandler):
|
||||
"""Render the admin page."""
|
||||
|
||||
@web.authenticated
|
||||
@admin_only
|
||||
def get(self):
|
||||
available = {'name', 'admin', 'running', 'last_activity'}
|
||||
|
@@ -92,8 +92,9 @@ async def test_home_auth(app):
|
||||
|
||||
|
||||
async def test_admin_no_auth(app):
|
||||
r = await get_page('admin', app)
|
||||
assert r.status_code == 403
|
||||
r = await get_page('admin', app, allow_redirects=False)
|
||||
assert r.status_code == 302
|
||||
assert '/hub/login' in r.headers['Location']
|
||||
|
||||
|
||||
async def test_admin_not_admin(app):
|
||||
|
Reference in New Issue
Block a user