diff --git a/flask_multipass_saml_groups/provider.py b/flask_multipass_saml_groups/provider.py index c8e06e8..a012c0d 100644 --- a/flask_multipass_saml_groups/provider.py +++ b/flask_multipass_saml_groups/provider.py @@ -5,7 +5,6 @@ import operator from datetime import datetime, timedelta, timezone from typing import Dict, Iterable, Optional, Type -from urllib.parse import urlsplit from flask import current_app, redirect, request, session, url_for from flask_multipass import ( diff --git a/tests/unit/test_provider.py b/tests/unit/test_provider.py index e2df1b1..9eb250c 100644 --- a/tests/unit/test_provider.py +++ b/tests/unit/test_provider.py @@ -485,9 +485,11 @@ def test_redirect_to_login_if_session_expired(app, client): with client.session_transaction() as sess: sess[EXPIRY_SESSION_KEY] = dt_now - timedelta(seconds=1) - resp = client.get("/sample") + next_url = "/sample" + resp = client.get(next_url) assert resp.status_code == 302 - assert resp.location == url_for(app.config["MULTIPASS_LOGIN_ENDPOINT"]) + assert url_for(app.config["MULTIPASS_LOGIN_ENDPOINT"]) in resp.location + assert next_url in resp.location @freeze_time("Jan 14th, 2024")