-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-3: Introduce endpoint for unauthorized page
- Loading branch information
1 parent
2e00d88
commit 33ce2c0
Showing
2 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,13 +34,19 @@ def test_callback_redirects_to_home(client: FlaskClient) -> None: | |
assert response.status_code == 302 and response.location == "/home" | ||
|
||
|
||
def test_callback_when_unauthorized_shows_unauthorized(client: FlaskClient) -> None: | ||
def test_callback_when_unauthorized_redirects_to_unauthorized(client: FlaskClient) -> None: | ||
current_app.extensions["users"].append("[email protected]") | ||
_given_oidc_returns_token_response({"id_token": "jwt"}) | ||
_given_oidc_returns_user_info(UserInfo({"email": "[email protected]"})) | ||
|
||
response = client.get("/auth") | ||
|
||
assert response.status_code == 302 and response.location == "/auth/unauthorized" | ||
|
||
|
||
def test_unauthorized(client: FlaskClient) -> None: | ||
response = client.get("/auth/unauthorized") | ||
|
||
assert response.status_code == 401 and response.text == "<h1>Unauthorized</h1>" | ||
|
||
|
||
|