mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
/-/auth-token as root redirects to /, closes #2375
This commit is contained in:
parent
feccfa2a4d
commit
81b68a143a
2 changed files with 9 additions and 0 deletions
|
|
@ -26,6 +26,12 @@ async def test_auth_token(ds_client):
|
|||
# Check that a second with same token fails
|
||||
assert ds_client.ds._root_token is None
|
||||
assert (await ds_client.get(path)).status_code == 403
|
||||
# But attempting with same token while logged in as root should redirect to /
|
||||
response = await ds_client.get(
|
||||
path, cookies={"ds_actor": ds_client.actor_cookie({"id": "root"})}
|
||||
)
|
||||
assert response.status_code == 302
|
||||
assert response.headers["Location"] == "/"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue