Launch NeoPass to all! <3 <3

This commit is contained in:
Emi Matchu 2024-04-12 06:51:20 -07:00
parent 7769016556
commit 410ace106e
3 changed files with 29 additions and 44 deletions

View file

@ -69,19 +69,6 @@ module ApplicationHelper
end end
end end
# Add ?neopass=1 to the URL, or set the `neopass_access_secret=1` cookie, to
# view NeoPass features. (NOTE: In production, this is a secret value
# instead!)
#
# NOTE: We intentionally don't e.g. set the cookie just because you went to
# the secret URL once, to avoid demo users getting confused about
# whether NeoPass is publicly available: if they go to the public page,
# they should NOT see NeoPass anymore, rather than think it's live!
def can_use_neopass
params[:neopass] == Rails.configuration.neopass_access_secret ||
cookies[:neopass_access_secret] == Rails.configuration.neopass_access_secret
end
def contact_email def contact_email
"matchu@openneo.net" "matchu@openneo.net"
end end

View file

@ -98,7 +98,7 @@
disabled: !@persisted_auth_user.uses_password? && disabled: !@persisted_auth_user.uses_password? &&
!@persisted_auth_user.email? %> !@persisted_auth_user.email? %>
<% end %> <% end %>
<% elsif can_use_neopass %> <% else %>
<%= form_with url: auth_user_neopass_omniauth_authorize_path(intent: "connect"), <%= form_with url: auth_user_neopass_omniauth_authorize_path(intent: "connect"),
method: :post, class: "settings-form", data: {turbo: false} do |form| method: :post, class: "settings-form", data: {turbo: false} do |form|
%> %>

View file

@ -29,38 +29,36 @@
</div> </div>
</section> </section>
<% if can_use_neopass %> <section class="login-option-neopass">
<section class="login-option-neopass"> <header>Have a NeoPass?</header>
<header>Have a NeoPass?</header>
<%= button_to auth_user_neopass_omniauth_authorize_path(intent: "login"), <%= button_to auth_user_neopass_omniauth_authorize_path(intent: "login"),
data: {turbo: false}, class: "log-in-with-neopass-button" do data: {turbo: false}, class: "log-in-with-neopass-button" do
%> %>
Log in with Log in with
<%= image_tag "neopass_icon.png", alt: "NeoPass", class: "neopass-icon" %> <%= image_tag "neopass_icon.png", alt: "NeoPass", class: "neopass-icon" %>
<% end %> <% end %>
<details class="neopass-explanation"> <details class="neopass-explanation">
<summary>How does it work?</summary> <summary>How does it work?</summary>
<p> <p>
If this is your first time using NeoPass at Dress to Impress, we'll If this is your first time using NeoPass at Dress to Impress, we'll
create a new DTI account for you automatically! create a new DTI account for you automatically!
</p> </p>
<p> <p>
You'll be asked for 3 permissions: <em>OpenID</em> and You'll be asked for 3 permissions: <em>OpenID</em> and
<em>Email</em> tell us who you are, and <em>Email</em> tell us who you are, and
<em>Linkage</em> tells us your Neopets username. <em>Linkage</em> tells us your Neopets username.
</p> </p>
<p> <p>
After that, you'll be able to one-click log in here, any time! After that, you'll be able to one-click log in here, any time!
</p> </p>
<p> <p>
To connect an existing DTI account, don't start here! Log in with To connect an existing DTI account, don't start here! Log in with
your password first, then check the Settings page. your password first, then check the Settings page.
</p> </p>
</details> </details>
</section> </section>
<% end %>
</div> </div>
<% content_for :stylesheets do %> <% content_for :stylesheets do %>