Compare commits
No commits in common. "40bfd42af6a6bca541b1ff56fd0ce6a8a7529a7f" and "77690165566f263efd83996bac323ee8dce244a7" have entirely different histories.
40bfd42af6
...
7769016556
5 changed files with 53 additions and 66 deletions
|
|
@ -69,15 +69,21 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def contact_email
|
# Add ?neopass=1 to the URL, or set the `neopass_access_secret=1` cookie, to
|
||||||
"matchu@openneo.net"
|
# 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
|
end
|
||||||
|
|
||||||
# SVG icon source from Chakra UI!
|
def contact_email
|
||||||
EXTERNAL_LINK_SVG_SOURCE = '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><path d="M15 3h6v6"></path><path d="M10 14L21 3"></path></g>'.html_safe
|
"matchu@openneo.net"
|
||||||
def external_link_icon
|
|
||||||
content_tag :svg, EXTERNAL_LINK_SVG_SOURCE, alt: "(external link)",
|
|
||||||
viewBox: "0 0 24 24", style: "width: 1em; height: 1em"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def flashes
|
def flashes
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ class User < ApplicationRecord
|
||||||
PreviewTopContributorsCount = 3
|
PreviewTopContributorsCount = 3
|
||||||
|
|
||||||
belongs_to :auth_user, foreign_key: :remote_id, inverse_of: :user
|
belongs_to :auth_user, foreign_key: :remote_id, inverse_of: :user
|
||||||
delegate :disconnect_neopass, :uses_neopass?, to: :auth_user
|
delegate :disconnect_neopass, to: :auth_user
|
||||||
|
|
||||||
has_many :closet_hangers
|
has_many :closet_hangers
|
||||||
has_many :closet_lists
|
has_many :closet_lists
|
||||||
|
|
|
||||||
|
|
@ -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 %>
|
||||||
<% else %>
|
<% elsif can_use_neopass %>
|
||||||
<%= 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|
|
||||||
%>
|
%>
|
||||||
|
|
@ -106,17 +106,6 @@
|
||||||
<section class="neopass-explanation">
|
<section class="neopass-explanation">
|
||||||
<p>
|
<p>
|
||||||
If you connect a NeoPass, you can use it to log into this DTI account!
|
If you connect a NeoPass, you can use it to log into this DTI account!
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
When you click below, you'll be connected to
|
|
||||||
<%= link_to "https://account.neopets.com/", target: "_blank" do %>
|
|
||||||
whatever NeoPass is already logged in
|
|
||||||
<%= external_link_icon %><% end %>.
|
|
||||||
If it's your first time connecting, 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>
|
|
||||||
You'll still be able to use your password to log in too, and you can
|
You'll still be able to use your password to log in too, and you can
|
||||||
disconnect this later if you'd like.
|
disconnect this later if you'd like.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -29,40 +29,38 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="login-option-neopass">
|
<% if can_use_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"),
|
<%= 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>
|
||||||
When you click the button above, we'll connect with
|
If this is your first time using NeoPass at Dress to Impress, we'll
|
||||||
<%= link_to "https://account.neopets.com/", target: "_blank" do %>
|
create a new DTI account for you automatically!
|
||||||
your currently logged-in NeoPass
|
</p>
|
||||||
<%= external_link_icon %><% end %>. If this is your first time here,
|
<p>
|
||||||
we'll create a new DTI account for you automatically!
|
You'll be asked for 3 permissions: <em>OpenID</em> and
|
||||||
</p>
|
<em>Email</em> tell us who you are, and
|
||||||
<p>
|
<em>Linkage</em> tells us your Neopets username.
|
||||||
You'll be asked for 3 permissions: <em>OpenID</em> and
|
</p>
|
||||||
<em>Email</em> tell us who you are, and
|
<p>
|
||||||
<em>Linkage</em> tells us your Neopets username.
|
After that, you'll be able to one-click log in here, any time!
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
After that, you'll be able to one-click log in here, any time! You'll
|
To connect an existing DTI account, don't start here! Log in with
|
||||||
never be asked for these permissions again.
|
your password first, then check the Settings page.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
</details>
|
||||||
To connect an existing DTI account, don't start here! Log in with
|
</section>
|
||||||
your password first, then connect via the Settings page.
|
<% end %>
|
||||||
</p>
|
|
||||||
</details>
|
|
||||||
</section>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% content_for :stylesheets do %>
|
<% content_for :stylesheets do %>
|
||||||
|
|
|
||||||
|
|
@ -11,26 +11,20 @@
|
||||||
.neopass-content
|
.neopass-content
|
||||||
%p
|
%p
|
||||||
%strong
|
%strong
|
||||||
🎉 Big news: Login with NeoPass is ready!
|
Big news: we're adding NeoPass and other integrations to DTI over the
|
||||||
- if user_signed_in?
|
coming months!
|
||||||
- if current_user.uses_neopass?
|
|
||||||
And hey, you're already on it, thank you for giving it a try!! 🥰
|
|
||||||
- else
|
|
||||||
You can connect your existing account via the
|
|
||||||
#{link_to "Settings page", edit_auth_user_path}.
|
|
||||||
- else
|
|
||||||
If you're new to Dress to Impress, try logging in right now!! 🎉
|
|
||||||
|
|
||||||
%p
|
%p
|
||||||
We're hoping NeoPass will help new users, and can be part of a more sustainable future for the site.
|
We're hoping it will help new users, and can be part of a more sustainable future for the site.
|
||||||
%br
|
%br
|
||||||
= link_to "Here's what's coming and why.", about_neopass_path
|
= link_to "Here's what's coming and why.", about_neopass_path
|
||||||
|
|
||||||
%p
|
%p
|
||||||
Big thanks to our beta testers! More to come soon! Thank you all for
|
%strong ➡️ Seeking beta testers, please!
|
||||||
your constant love and support! 💖
|
We need help making sure NeoPass login actually works reliably!
|
||||||
%br
|
%br
|
||||||
%em —Matchu
|
= link_to "Check out the secret testing info",
|
||||||
|
"https://forms.gle/hEkw5bXY1W4YhUZb7"
|
||||||
|
and let us know how it goes! Thank you!! 💖
|
||||||
|
|
||||||
#outfit-forms
|
#outfit-forms
|
||||||
- localized_cache :action_suffix => 'outfit_forms_intro' do
|
- localized_cache :action_suffix => 'outfit_forms_intro' do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue