From 5865d79ed9ed6e6ed3e4ba6699e8731beca06830 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sat, 6 Dec 2025 13:43:48 -0500 Subject: [PATCH] Display the verification code in the dev env This seems better and easier than the console log. --- app/assets/stylesheets/animation.css | 5 +++++ app/views/sessions/magic_links/show.html.erb | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/animation.css b/app/assets/stylesheets/animation.css index 8c617a1d7..d6f05efa9 100644 --- a/app/assets/stylesheets/animation.css +++ b/app/assets/stylesheets/animation.css @@ -44,6 +44,11 @@ to { transform: translateY(0); } } + @keyframes slide-up-fade-in { + from { transform: translateY(2rem); opacity: 0; } + to { transform: translateY(0); opacity: 1; } + } + @keyframes slide-down { from { transform: translateY(0); } to { transform: translateY(2rem); } diff --git a/app/views/sessions/magic_links/show.html.erb b/app/views/sessions/magic_links/show.html.erb index 7eca24264..4e94f411e 100644 --- a/app/views/sessions/magic_links/show.html.erb +++ b/app/views/sessions/magic_links/show.html.erb @@ -16,10 +16,12 @@

The code you receive will work for <%= distance_of_time_in_words(MagicLink::EXPIRATION_TIME) %>.

-<% if Rails.env.development? %> - <%= javascript_tag do %> - console.log("Magic link code: <%= flash[:magic_link_code].presence || "not generated" %>"); - <% end %> +<% if Rails.env.development? && flash[:magic_link_code].present? %> +
+ Psst, here's your code: + <%= flash[:magic_link_code] %> + DEV +
<% end %> <% content_for :footer do %>