1
0
Fork 0
forked from OpenNeo/impress

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,7 +29,6 @@
</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>
@ -60,7 +59,6 @@
</p> </p>
</details> </details>
</section> </section>
<% end %>
</div> </div>
<% content_for :stylesheets do %> <% content_for :stylesheets do %>