mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33:02 +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):
|
class AdminHandler(BaseHandler):
|
||||||
"""Render the admin page."""
|
"""Render the admin page."""
|
||||||
|
|
||||||
|
@web.authenticated
|
||||||
@admin_only
|
@admin_only
|
||||||
def get(self):
|
def get(self):
|
||||||
available = {'name', 'admin', 'running', 'last_activity'}
|
available = {'name', 'admin', 'running', 'last_activity'}
|
||||||
|
@@ -92,8 +92,9 @@ async def test_home_auth(app):
|
|||||||
|
|
||||||
|
|
||||||
async def test_admin_no_auth(app):
|
async def test_admin_no_auth(app):
|
||||||
r = await get_page('admin', app)
|
r = await get_page('admin', app, allow_redirects=False)
|
||||||
assert r.status_code == 403
|
assert r.status_code == 302
|
||||||
|
assert '/hub/login' in r.headers['Location']
|
||||||
|
|
||||||
|
|
||||||
async def test_admin_not_admin(app):
|
async def test_admin_not_admin(app):
|
||||||
|
Reference in New Issue
Block a user