From ed0f5a7b9eb52863364e79e46f8ebacc3bd34825 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Mon, 10 Jun 2024 16:05:59 -0700 Subject: [PATCH] removed old login announcement page and added new sign in button --- app/assets/images/logo-login.svg | 1 + .../uswds/_uswds-theme-custom-styles.scss | 13 +++++ app/main/views/index.py | 15 +++++- app/templates/views/signedout.html | 2 +- app/templates/views/signin.html | 53 ------------------- 5 files changed, 28 insertions(+), 56 deletions(-) create mode 100644 app/assets/images/logo-login.svg delete mode 100644 app/templates/views/signin.html diff --git a/app/assets/images/logo-login.svg b/app/assets/images/logo-login.svg new file mode 100644 index 000000000..019713377 --- /dev/null +++ b/app/assets/images/logo-login.svg @@ -0,0 +1 @@ + diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index d66e276bd..0451be565 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -157,6 +157,19 @@ td.table-empty-message { } } +.usa-button svg { + margin-left: .5rem; + height: 1rem; +} + +.login-button.login-button--primary, .login-button.login-button--primary:hover { + color: #112e51; + background-color: #fff; + border: 1px solid #767676; + display: inline-flex; + justify-content: center; +} + .user-list-edit-link:active:before, .user-list-edit-link:focus:before { box-shadow: none; diff --git a/app/main/views/index.py b/app/main/views/index.py index c68605b2e..7c6c6a68c 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -1,6 +1,6 @@ import os -from flask import abort, redirect, render_template, request, url_for +from flask import abort, current_app, redirect, render_template, request, url_for from flask_login import current_user from app import status_api_client @@ -9,6 +9,7 @@ from app.main import main from app.main.views.pricing import CURRENT_SMS_RATE from app.main.views.sub_navigation_dictionaries import features_nav, using_notify_nav from app.utils.user import user_is_logged_in +from notifications_utils.url_safe_token import generate_token login_dot_gov_url = os.getenv("LOGIN_DOT_GOV_INITIAL_SIGNIN_URL") @@ -17,12 +18,22 @@ login_dot_gov_url = os.getenv("LOGIN_DOT_GOV_INITIAL_SIGNIN_URL") def index(): if current_user and current_user.is_authenticated: return redirect(url_for("main.choose_account")) - + token = generate_token( + str(request.remote_addr), + current_app.config["SECRET_KEY"], + current_app.config["DANGEROUS_SALT"], + ) + url = os.getenv("LOGIN_DOT_GOV_INITIAL_SIGNIN_URL") + # handle unit tests + if url is not None: + url = url.replace("NONCE", token) + url = url.replace("STATE", token) return render_template( "views/signedout.html", sms_rate=CURRENT_SMS_RATE, counts=status_api_client.get_count_of_live_services_and_organizations(), login_dot_gov_url=login_dot_gov_url, + initial_signin_url=url, ) diff --git a/app/templates/views/signedout.html b/app/templates/views/signedout.html index a2aa554f0..9d19d8b9f 100644 --- a/app/templates/views/signedout.html +++ b/app/templates/views/signedout.html @@ -21,7 +21,7 @@ Notify.gov

Reach people where they are with government-powered text messages

Notify.gov is a text message service that helps federal, state, local, tribal and territorial governments more effectively communicate with the people they serve.

- Sign in + if you are an existing pilot partner

Currently we are only working with select pilot partners. If you are interested in using Notify.gov in the future, please contact
tts-benefits-studio@gsa.gov to learn more.

diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html deleted file mode 100644 index f3b3006d7..000000000 --- a/app/templates/views/signin.html +++ /dev/null @@ -1,53 +0,0 @@ -{% extends "base.html" %} -{% from "components/page-footer.html" import page_footer %} -{% from "components/form.html" import form_wrapper %} - -{% block per_page_title %} - {% if again %} - You need to sign in again - {% else %} - Sign in - {% endif %} -{% endblock %} - -{% block maincolumn_content %} - -
-
- {% if again %} -

You need to sign in again

- {% if other_device %} -

- We signed you out because you logged in to Notify on another device. -

- {% else %} -

- We signed you out because you have not used Notify for a while. -

- {% endif %} - Sign in with Login.gov - {% else %} -

Sign in

-

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

- Sign in with Login.gov - {% endif %} -
-
-

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
  • -
  • One single source for signing in: You can use Login.gov for other services within the federal government
  • -
  • 2FA flexibility: Login.gov supports multiple methods for users to verify their identity.
  • -
-

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 to continue to access Notify.
  • -
-
- Create Login.gov account -
-
- -{% endblock %}