From 6784cf9f3cd7b96b8073c20e892cb68f05eca7f0 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Mon, 15 Apr 2024 15:50:42 -0400 Subject: [PATCH] 1423 - Few final updates to switch over to login.gov --- app/main/views/sign_in.py | 1 - app/templates/views/signin.html | 33 ++++------------------ poetry.lock | 2 +- tests/app/main/views/test_accept_invite.py | 9 ++---- tests/app/main/views/test_sign_in.py | 31 ++++---------------- 5 files changed, 15 insertions(+), 61 deletions(-) diff --git a/app/main/views/sign_in.py b/app/main/views/sign_in.py index 6de46b023..f5870c2e1 100644 --- a/app/main/views/sign_in.py +++ b/app/main/views/sign_in.py @@ -197,7 +197,6 @@ def sign_in(): form=form, again=bool(redirect_url), other_device=other_device, - login_gov_enabled=True, password_reset_url=password_reset_url, initial_signin_url=url, ) diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index 6d6f578ee..5532eb7c1 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -12,18 +12,6 @@ {% block maincolumn_content %} -{% if login_gov_enabled %} -
-
-
-

Login.gov is required by April 16, 2024

-

- You have left to use Login.gov to sign in -

-
-
-
-{% endif %}
{% if again %} @@ -39,22 +27,12 @@ {% endif %} {% else %}

Sign in

- {% if login_gov_enabled %} -

You can access your account by signing in with one of the options below:

- Sign in with Login.gov -

Or:

- {% endif %} +

Access your Notify.gov account by signing in with Login.gov:

+ Sign in with Login.gov {% endif %} - - {% call form_wrapper(autocomplete=True) %} - {{ form.email_address(param_extensions={"autocomplete": "email"}) }} - {{ form.password(param_extensions={"autocomplete": "current-password"}) }} - {{ page_footer("Continue", secondary_link=password_reset_url, secondary_link_text="Forgot your password?") }} - {% endcall %}
- {% if login_gov_enabled %}
-

Notify.gov is changing the sign-in experience to Login.gov effective
April 16, 2024

+

Effective April 16, 2024 Notify.gov requires you sign-in through Login.gov

Why are we doing this?

  • Enhanced security: Login.gov is really secure and trustworthy
  • @@ -64,12 +42,11 @@

    What do I need to do?

    • If you have a Login.gov account, start using it to sign in to Notify today.
    • -
    • If you don’t have a Login.gov account, you must create one by April 16, 2024 to continue to access Notify.
    • +
    • If you don’t have a Login.gov account, you must create one to continue to access Notify.
    - Create Login.gov account + Create Login.gov account
-{% endif %} {% endblock %} diff --git a/poetry.lock b/poetry.lock index 21064bf51..e46765a4f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1516,7 +1516,6 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, - {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -2383,6 +2382,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, diff --git a/tests/app/main/views/test_accept_invite.py b/tests/app/main/views/test_accept_invite.py index c677eeec2..d1eadc28f 100644 --- a/tests/app/main/views/test_accept_invite.py +++ b/tests/app/main/views/test_accept_invite.py @@ -222,8 +222,7 @@ def test_if_existing_user_accepts_twice_they_redirect_to_sign_in( ) == ( "You need to sign in again", # TODO: Improve this given Login.gov configuration. - # "We signed you out because you have not used Notify for a while.", - "You have left to use Login.gov to sign in", + "We signed you out because you have not used Notify for a while.", ) # We don’t let people update `email_access_validated_at` using an # already-accepted invite @@ -338,8 +337,7 @@ def test_existing_user_of_service_get_redirected_to_signin( ) == ( "You need to sign in again", # TODO: Improve this given Login.gov configuration. - # "We signed you out because you have not used Notify for a while.", - "You have left to use Login.gov to sign in", + "We signed you out because you have not used Notify for a while.", ) assert mock_accept_invite.call_count == 1 @@ -429,8 +427,7 @@ def test_existing_signed_out_user_accept_invite_redirects_to_sign_in( ) == ( "You need to sign in again", # TODO: Improve this given Login.gov configuration. - # "We signed you out because you have not used Notify for a while.", - "You have left to use Login.gov to sign in", + "We signed you out because you have not used Notify for a while.", ) diff --git a/tests/app/main/views/test_sign_in.py b/tests/app/main/views/test_sign_in.py index ddb7a8b08..e89cb6e7b 100644 --- a/tests/app/main/views/test_sign_in.py +++ b/tests/app/main/views/test_sign_in.py @@ -12,40 +12,21 @@ def test_render_sign_in_template_for_new_user(client_request): client_request.logout() page = client_request.get("main.sign_in") assert normalize_spaces(page.select_one("h1").text) == "Sign in" - assert normalize_spaces(page.select("label")[0].text) == "Email address" - assert page.select_one("#email_address").get("value") is None - assert page.select_one("#email_address")["autocomplete"] == "email" - assert normalize_spaces(page.select("label")[1].text) == "Password" - assert page.select_one("#password").get("value") is None - assert page.select_one("#password")["autocomplete"] == "current-password" - # Removing for the pilot - # assert page.select('main a')[0].text == 'create one now' - # assert page.select('main a')[0]['href'] == url_for('main.register') + assert ( + page.select("main p")[0].text + == "Access your Notify.gov account by signing in with Login.gov:" + ) # TODO: Fix this test to be less brittle! If the Login.gov link is enabled, # then these indices need to be 1 instead of 0. # Currently it's not enabled for the test or production environments. - assert page.select("main a")[1].text == "Forgot your password?" - assert page.select("main a")[1]["href"] == url_for("main.forgot_password") + assert page.select("main a")[0].text == "Sign in with Login.gov" + assert page.select("main a")[1].text == "Create Login.gov account" # TODO: We'll have to adjust this depending on whether Login.gov is # enabled or not; fix this in the future. assert "Sign in again" not in normalize_spaces(page.text) -def test_render_sign_in_template_with_next_link_for_password_reset(client_request): - client_request.logout() - page = client_request.get( - "main.sign_in", - _optional_args=f"?next=/services/{SERVICE_ONE_ID}/templates", - _test_page_title=False, - ) - forgot_password_link = page.find("a", class_="usa-link") - assert forgot_password_link.text == "Forgot your password?" - assert forgot_password_link["href"] == url_for( - "main.forgot_password", next=f"/services/{SERVICE_ONE_ID}/templates" - ) - - def test_reformat_keystring(): orig = "-----BEGIN PRIVATE KEY----- blah blah blah -----END PRIVATE KEY-----" expected = """-----BEGIN PRIVATE KEY-----