1
0
Fork 0
forked from OpenNeo/impress
impress/app/views/devise/sessions/new.html.erb
Emi Matchu aa0b376a12 Clarify NeoPass explanations
In particular, we got feedback that it was surprising to not get to
check which NeoPass you wanted to use, and that the permissions were
never prompted again. I figure let's err on the side of ample clarity!

As part of this, I've added the new `external_link_icon` global helper,
which embeds an SVG from Chakra UI. That's just the convenient place I
know to grab that icon, and I did it this way instead of an `img` tag
because that enables the `currentColor` thing to work instead of coming
out black!
2024-04-12 07:14:34 -07:00

70 lines
2.3 KiB
Text

<% title "Log into Dress to Impress" %>
<div class="login-options">
<section class="login-option-password">
<%= form_with(model: resource, url: session_path(resource_name),
class: "login-form") do |f| %>
<div class="field input-field">
<%= f.label :name, 'DTI Username' %><br />
<%= f.text_field :name, autofocus: true, autocomplete: "username" %>
</div>
<div class="field input-field">
<%= f.label :password, "DTI Password" %><br />
<%= f.password_field :password, autocomplete: "current-password" %>
</div>
<div class="actions">
<%= f.submit "Log in" %>
<div class="remember-me">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
</div>
</div>
<% end %>
<div class="login-links">
<%= link_to "Sign up", new_auth_user_path %>
<%= link_to "Forgot your password?", new_auth_user_password_path %>
</div>
</section>
<section class="login-option-neopass">
<header>Have a NeoPass?</header>
<%= button_to auth_user_neopass_omniauth_authorize_path(intent: "login"),
data: {turbo: false}, class: "log-in-with-neopass-button" do
%>
Log in with
<%= image_tag "neopass_icon.png", alt: "NeoPass", class: "neopass-icon" %>
<% end %>
<details class="neopass-explanation">
<summary>How does it work?</summary>
<p>
When you click the button above, we'll connect with
<%= link_to "https://account.neopets.com/", target: "_blank" do %>
your currently logged-in NeoPass
<%= external_link_icon %><% end %>. If this is your first time here,
we'll create a new DTI account for you automatically!
</p>
<p>
You'll be asked for 3 permissions: <em>OpenID</em> and
<em>Email</em> tell us who you are, and
<em>Linkage</em> tells us your Neopets username.
</p>
<p>
After that, you'll be able to one-click log in here, any time! You'll
never be asked for these permissions again.
</p>
<p>
To connect an existing DTI account, don't start here! Log in with
your password first, then connect via the Settings page.
</p>
</details>
</section>
</div>
<% content_for :stylesheets do %>
<%= stylesheet_link_tag "devise/sessions/new" %>
<% end %>