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
# 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
"matchu@openneo.net"
end

View File

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

View File

@ -29,38 +29,36 @@
</div>
</section>
<% if can_use_neopass %>
<section class="login-option-neopass">
<header>Have a NeoPass?</header>
<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 %>
<%= 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>
If this is your first time using NeoPass at Dress to Impress, 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!
</p>
<p>
To connect an existing DTI account, don't start here! Log in with
your password first, then check the Settings page.
</p>
</details>
</section>
<% end %>
<details class="neopass-explanation">
<summary>How does it work?</summary>
<p>
If this is your first time using NeoPass at Dress to Impress, 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!
</p>
<p>
To connect an existing DTI account, don't start here! Log in with
your password first, then check the Settings page.
</p>
</details>
</section>
</div>
<% content_for :stylesheets do %>