1
0
mirror of https://github.com/projekteuler/projekteuler.git synced 2025-12-10 00:36:42 +01:00

Fix broken OmniAuth login

This commit is contained in:
Philipp Fischbeck 2021-05-20 09:25:44 +02:00
parent a57eca5737
commit c81a590adb
4 changed files with 8 additions and 3 deletions

View File

@ -52,6 +52,7 @@ gem 'will_paginate-bootstrap4', '~> 0.2.2'
gem 'devise', '~> 4.8.0'
gem 'omniauth'
gem 'omniauth-rails_csrf_protection'
gem 'omniauth-github'
# Use ActiveModel has_secure_password

View File

@ -160,6 +160,9 @@ GEM
omniauth-oauth2 (1.7.1)
oauth2 (~> 1.4)
omniauth (>= 1.9, < 3)
omniauth-rails_csrf_protection (1.0.0)
actionpack (>= 4.2)
omniauth (~> 2.0)
orm_adapter (0.5.0)
popper_js (1.16.0)
public_suffix (4.0.6)
@ -278,6 +281,7 @@ DEPENDENCIES
mysql2 (~> 0.5.2)
omniauth
omniauth-github
omniauth-rails_csrf_protection
puma (~> 5.0)
rails (= 6.1.3.2)
rails-controller-testing

View File

@ -32,9 +32,9 @@
<% else %>
<li class="nav-item">
<% if Rails.env.development? %>
<%= link_to t('application.sign_in_with_github'), user_developer_omniauth_authorize_path, class: 'nav-link' %>
<%= link_to t('application.sign_in_with_github'), user_developer_omniauth_authorize_path, method: :post, class: 'nav-link' %>
<% else %>
<%= link_to t('application.sign_in_with_github'), user_github_omniauth_authorize_path, class: 'nav-link' %>
<%= link_to t('application.sign_in_with_github'), user_github_omniauth_authorize_path, method: :post, class: 'nav-link' %>
<% end %>
</li>
<% end %>

View File

@ -8,7 +8,7 @@ class TranslatorFlowTest < ActionDispatch::IntegrationTest
end
test "can login via github" do
get '/users/auth/github'
post '/users/auth/github'
assert_response :redirect
follow_redirect!
follow_redirect!