Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

152 update omniauth #257

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ gem "jbuilder"
gem "oauth2", "~> 2.0.x"
gem "omniauth", "~> 2.1", ">= 2.1.2"
gem "omniauth-orcid"
gem "omniauth-rails_csrf_protection"
gem "pg"
gem "puma", "5.6.8"
gem "rack", "2.2.8.1"
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ GEM
omniauth-orcid (2.1.1)
omniauth-oauth2 (~> 1.3)
ruby_dig (~> 0.0.2)
omniauth-rails_csrf_protection (1.0.2)
actionpack (>= 4.2)
omniauth (~> 2.0)
openapi3_parser (0.9.2)
commonmarker (~> 0.17)
openapi_parser (1.0.0)
Expand Down Expand Up @@ -551,6 +554,7 @@ DEPENDENCIES
omniauth (~> 2.1, >= 2.1.2)
omniauth-cas (~> 3.0)
omniauth-orcid
omniauth-rails_csrf_protection
pg
pry-byebug
puma (= 5.6.8)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def session_path(_scope)
end

def after_sign_in_path_for(_resource)
"/users/#{@user.id}"
"/users/#{current_user.id}"
end
end
19 changes: 19 additions & 0 deletions app/javascript/entrypoints/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,30 @@ a {
margin-right: 2rem;
}

#login-button-black {
box-shadow: 10px 10px #E57401;
font-family: "Montserrat", sans-serif;
font-weight: bold;
font-size: 1.3rem;
color: #fff;
background-color: #000;
border: none;
padding: 0.7rem 2.4rem;
height: 3.5rem;
margin: 3rem 2rem;
}

#text-box,
#login-button {
display: inline-block;
}

#sign-in-page {
max-width: 1440px;
min-width: 710px;
margin: 1rem auto 0 auto;
}

.line {
background-color: #E77500;
width: 100%;
Expand Down
5 changes: 5 additions & 0 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div id="sign-in-page">
<h2 class="info-title">Log in to ORCID@Princeton</h2>
<%= button_to "Log-in", user_cas_omniauth_authorize_path, :id => "login-button-black", :type => 'submit', :onclick => "log_plausible_cas_user_login()", :method => :post %>
<div class="line"></div>
</div>
2 changes: 1 addition & 1 deletion app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div id="text-box">
<p>Connect your ORCID id to Princeton so that published works can be easily identified as belonging to all Princeton researchers.</p>
</div>
<%= button_to "Log-in", user_cas_omniauth_authorize_path, :id => "login-button", :onclick => "log_plausible_cas_user_login()", :method => :get %>
<%= button_to "Log-in", user_cas_omniauth_authorize_path, :id => "login-button", :type => 'submit', :onclick => "log_plausible_cas_user_login()", :method => :post %>
</div>
</div>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

devise_scope :user do
get "sign_in", to: "devise/sessions#new", as: :new_user_session
get "sign_in", to: "users/omniauth_callbacks#passthru", as: :session
get "sign_out", to: "devise/sessions#destroy", as: :destroy_user_session
post ":id/validate-tokens", to: "users#validate_tokens", as: :validate_tokens
end
Expand Down