Redirect to home after login, which redirects elsewhere
This commit is contained in:
parent
2e77387d98
commit
fa105a95e3
@ -17,7 +17,7 @@ def root():
|
||||
|
||||
@bp.route("/home")
|
||||
def home():
|
||||
return render_template("home.html")
|
||||
return redirect(url_for("requests.requests_index"))
|
||||
|
||||
|
||||
@bp.route("/styleguide")
|
||||
@ -46,7 +46,7 @@ def login_redirect():
|
||||
user = auth_context.get_user()
|
||||
session["user_id"] = user.id
|
||||
|
||||
return redirect(url_for("requests.requests_index"))
|
||||
return redirect(url_for(".home"))
|
||||
|
||||
|
||||
def _is_valid_certificate(request):
|
||||
|
@ -63,4 +63,4 @@ def login_dev():
|
||||
)
|
||||
session["user_id"] = user.id
|
||||
|
||||
return redirect(url_for("requests.requests_index"))
|
||||
return redirect(url_for("atst.home"))
|
||||
|
@ -8,12 +8,12 @@ def test_user_with_workspaces_has_workspaces_nav(client, user_session):
|
||||
Workspaces._create_workspace_role(user, workspace, "default")
|
||||
|
||||
user_session(user)
|
||||
response = client.get("/home")
|
||||
response = client.get("/home", follow_redirects=True)
|
||||
assert b'href="/workspaces"' in response.data
|
||||
|
||||
|
||||
def test_user_without_workspaces_has_no_workspaces_nav(client, user_session):
|
||||
user = UserFactory.create()
|
||||
user_session(user)
|
||||
response = client.get("/home")
|
||||
response = client.get("/home", follow_redirects=True)
|
||||
assert b'href="/workspaces"' not in response.data
|
||||
|
@ -33,7 +33,7 @@ def test_successful_login_redirect_non_ccpo(client, monkeypatch):
|
||||
)
|
||||
|
||||
assert resp.status_code == 302
|
||||
assert "requests" in resp.headers["Location"]
|
||||
assert "home" in resp.headers["Location"]
|
||||
assert session["user_id"]
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ def test_successful_login_redirect_ccpo(client, monkeypatch):
|
||||
)
|
||||
|
||||
assert resp.status_code == 302
|
||||
assert "requests" in resp.headers["Location"]
|
||||
assert "home" in resp.headers["Location"]
|
||||
assert session["user_id"]
|
||||
|
||||
|
||||
@ -119,8 +119,6 @@ def test_crl_validation_on_login(client):
|
||||
"HTTP_X_SSL_CLIENT_CERT": good_cert,
|
||||
},
|
||||
)
|
||||
assert resp.status_code == 302
|
||||
assert "requests" in resp.headers["Location"]
|
||||
assert session["user_id"]
|
||||
|
||||
|
||||
|
@ -5,7 +5,6 @@ import pytest
|
||||
"path",
|
||||
(
|
||||
"/",
|
||||
"/home",
|
||||
"/workspaces",
|
||||
"/requests",
|
||||
"/requests/new/1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user