diff --git a/app/assets/stylesheets/modules/home.css b/app/assets/stylesheets/modules/home.css index c98b5f295b8..0201cd1b404 100644 --- a/app/assets/stylesheets/modules/home.css +++ b/app/assets/stylesheets/modules/home.css @@ -152,3 +152,24 @@ font-size: 16px; } .home__link:focus { outline: none; } + +/* Banner */ + +.banner { + background-color: #141c22; + text-align: center; + padding: 15px; + color: white; +} + +@media (max-width: 899px) { + .banner { + font-size: 12px; + } +} + +.banner a { + color: #e9573f; + text-decoration: underline; + font-weight: bold; +} diff --git a/app/assets/stylesheets/modules/org.css b/app/assets/stylesheets/modules/org.css index a65d3b1d2f0..17f9a0be4c8 100644 --- a/app/assets/stylesheets/modules/org.css +++ b/app/assets/stylesheets/modules/org.css @@ -1,18 +1,19 @@ /* Flash Intercoms */ .flash { - border-bottom: 1px solid #e9573f; - background-color: white; } + border-bottom: 1px solid #dcd3b1; + background-color: white; +} .flash-wrap { - padding-top: 5px; - padding-bottom: 5px; - background-image: linear-gradient(to right, rgba(233, 87, 63, 0.3), #e9573f); } + padding: 10px 0; + background-color: #fff6d2; +} .flash-wrap span { font-size: 13px; - font-style: italic; - color: #141c22; } + color: #141c22; +} .flash a { color: #141c22; @@ -265,3 +266,20 @@ float: right; } .about__assets__download:focus:before, .about__assets__download:hover:before { animation: arrow .75s infinite; } + +/* Banner */ + +#banner { + background-color: #141c22; + text-align: center; + padding: 12px 0; + font-weight: 500; + font-size: 16px; + color: white; +} + +#banner a { + color: #e9573f; + text-decoration: underline; + font-weight: bold; +} diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index d9a128e0e4b..975c58e83b2 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -80,6 +80,7 @@ def do_login sign_in(@user) do |status| if status.success? StatsD.increment "login.success" + set_login_flash redirect_back_or(url_after_create) else login_failure(status.failure_message) @@ -107,12 +108,20 @@ def who session_params[:who].is_a?(String) && session_params.fetch(:who) end - def url_after_create + def set_login_flash if current_user.mfa_recommended_not_yet_enabled? flash[:notice] = t("multifactor_auths.setup_recommended") - new_multifactor_auth_path elsif current_user.mfa_recommended_weak_level_enabled? flash[:notice] = t("multifactor_auths.strong_mfa_level_recommended") + elsif !current_user.webauthn_enabled? + flash[:notice_html] = t("multifactor_auths.setup_webauthn_html") + end + end + + def url_after_create + if current_user.mfa_recommended_not_yet_enabled? + new_multifactor_auth_path + elsif current_user.mfa_recommended_weak_level_enabled? edit_settings_path else dashboard_path diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 22134450d73..abf96f11cd2 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,3 +1,7 @@ +<% content_for :banner do %> + <%= t('multifactor_auths.setup_webauthn_html') %> +<% end %> +
<%= t(".webauthn_credential_note")%>
+ + <% if @user.webauthn_credentials.none? %> +<%= t(".no_webauthn_credentials") %>
+ <% else %> +<%= t(".webauthn_credential_note")%>
- - <% if @user.webauthn_credentials.none? %> -<%= t(".no_webauthn_credentials") %>
- <% else %> -