Skip to content

Commit

Permalink
Merge pull request #413 from openstax/fix-login
Browse files Browse the repository at this point in the history
Change login methods back to GET, fix accounts stubbing env variable
  • Loading branch information
Dantemss authored Feb 26, 2025
2 parents 8bf80ea + cd2fe9d commit 023fba7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ GEM
aws-sigv4 (1.10.1)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
bigdecimal (3.1.8)
bigdecimal (3.1.9)
bindex (0.8.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
Expand Down Expand Up @@ -216,8 +216,8 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (7.0.0)
railties (>= 3.2.16)
json (2.9.1)
jwt (2.9.3)
json (2.10.1)
jwt (2.10.1)
base64
keyword_search (1.5.0)
kramdown (2.5.1)
Expand All @@ -238,7 +238,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.4)
logger (1.6.6)
lograge (0.14.0)
actionpack (>= 4)
activesupport (>= 4)
Expand Down Expand Up @@ -557,10 +557,10 @@ GEM
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.2)
uri (1.0.3)
vcr (6.3.1)
base64
version_gem (1.1.4)
version_gem (1.1.6)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/_application_account_bar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<%= vertical_bar(id: "account-bar-vertical-bar", class: "#{account_bar_classes}") %>
<%= link_to "Sign out", openstax_accounts.logout_url, class: "#{account_bar_classes}", :'data-test-link-sign-out' => "", method: :delete %>
<% else %>
<%= link_to "Join now", openstax_accounts.login_url, class: "#{account_bar_classes}", :'data-test-link-join' => "" %>
<%= link_to "Join now", openstax_accounts.login_url, class: "#{account_bar_classes}", 'data-test-link-join': "" %>
<%= vertical_bar(id: "account-bar-vertical-bar", class: "#{account_bar_classes}") %>
<%= link_to "Sign in", openstax_accounts.login_url, class: "#{account_bar_classes}", :'data-test-link-sign-in' => "" %>
<%= link_to "Sign in", openstax_accounts.login_url, class: "#{account_bar_classes}", 'data-test-link-sign-in': "" %>
<% end %>

<%= link_to "http://www.facebook.com/openstaxtutor", id: "facebook-link" do %>
Expand Down
6 changes: 5 additions & 1 deletion config/initializers/openstax_accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
secrets = Rails.application.secrets.openstax[:accounts]

# By default, stub unless in the production environment
stub = secrets[:stub].nil? ? !Rails.env.production? : secrets[:stub]
stub = secrets[:stub].nil? ? !Rails.env.production? :
ActiveAttr::Typecasting::BooleanTypecaster.new.call(secrets[:stub])

OpenStax::Accounts.configure do |config|
config.openstax_application_id = secrets[:client_id]
Expand All @@ -13,3 +14,6 @@
config.logout_via = :delete
config.account_user_mapper = UserMapper
end if secrets[:url]

OmniAuth.config.allowed_request_methods = [:get, :post]
OmniAuth.config.silence_get_warning = true

0 comments on commit 023fba7

Please sign in to comment.