Skip to content

Commit

Permalink
checkpoint1 codeclimate errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthBansal committed Jun 9, 2018
1 parent b8a1413 commit cd83f92
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/user_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create
redirect_to root_url, notice: "Already linked to another account!"
end
else
if @identity && @identity.user.present?
if @identity&.user.present?
# The identity we found had a user associated with it so let's
# just log them in here
self.current_user = @identity.user
Expand Down
1 change: 1 addition & 0 deletions app/models/user_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class UserTag < ActiveRecord::Base

validates :value, presence: :true
validates :value, format: { with: /\A[\w\.:-]*\z/, message: 'can only include letters, numbers, and dashes' }
validates_uniqueness_of :value, :scope => :uid
before_save :preprocess

def preprocess
Expand Down
5 changes: 5 additions & 0 deletions app/views/users/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
<hr />

<%= render 'form' %>
<div class="row" style="display:flex;">
<div class="loginbutton" >
<%= link_to "Link with Google", "/auth/google_oauth2", class: "btn btn-primary" %>
</div>
</div>

</div>
2 changes: 1 addition & 1 deletion config/initializers/omniauth.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, ENV["google_app_key"],ENV["google_app_secret"] , skip_jwt: true
provider :facebook, ENV["APP_ID"],ENV["APP_SECRET"] , skip_jwt: true
provider :facebook, ENV["APP_ID"],ENV["APP_SECRET"], { scope: "email,public_profile,user_likes" }
end

0 comments on commit cd83f92

Please sign in to comment.