mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(routers.trusted_user): use creds to determine authorization
Closes #237 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
9d221604b4
commit
059733cb8c
4 changed files with 71 additions and 34 deletions
|
@ -1857,3 +1857,11 @@ def test_account_comments_not_found(client: TestClient, user: User):
|
|||
with client as request:
|
||||
resp = request.get("/account/non-existent/comments", cookies=cookies)
|
||||
assert resp.status_code == int(HTTPStatus.NOT_FOUND)
|
||||
|
||||
|
||||
def test_accounts_unauthorized(client: TestClient, user: User):
|
||||
cookies = {"AURSID": user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
resp = request.get("/accounts", cookies=cookies, allow_redirects=False)
|
||||
assert resp.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
assert resp.headers.get("location") == "/"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue