Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/becarella/let_me_in
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Buskirk committed May 19, 2012
2 parents 616751d + 309345b commit 3e1f86c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 24 deletions.
17 changes: 9 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ GIT
omniauth-banters (0.2.0)
omniauth-oauth2 (~> 1.0.0)

GIT
remote: git://github.com/becarella/render_or_redirect.git
revision: c9d0f2236e275950d7abd6dc2401975fdf84aa32
specs:
render_or_redirect (0.0.1)
rails

PATH
remote: .
specs:
let_me_in (0.0.1)
bcrypt-ruby (~> 3.0.0)
omniauth-identity
rails (~> 3.1.4)

PATH
remote: ../render_or_redirect
specs:
render_or_redirect (0.0.1)
rails (~> 3.1.1)
rails

GEM
remote: http://rubygems.org/
Expand Down Expand Up @@ -189,7 +190,7 @@ GEM
sprockets (2.0.4)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
tilt (!= 1.3.0, ~> 1.1)
sqlite3 (1.3.6)
therubyracer (0.9.10)
libv8 (~> 3.3.10)
Expand Down
4 changes: 0 additions & 4 deletions app/controllers/let_me_in/auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ def callback
clear_return_path
options = {:redirect_url => main_app.post_login_path}
data = User.find_or_create_by_auth_hash auth_hash
Rails.logger.debug "user: #{data.inspect}"
sign_in(data) if data
else
Rails.logger.debug "account_types: #{LetMeIn::Engine.config.account_types.inspect}"
Rails.logger.debug "looking for: #{params[:provider].downcase}"
provider_class = LetMeIn::Engine.config.account_types
.select{|p| p.name.downcase =~ /#{params[:provider].downcase}/i}[0]
Rails.logger.debug "provider_class: #{provider_class}"
data = provider_class.link(auth_hash, current_user)
end
render_or_redirect data.serializable_hash, options || {}
Expand Down
2 changes: 1 addition & 1 deletion let_me_in.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["spec/**/*"]

s.add_dependency "rails", "~> 3.1.4"
s.add_dependency "rails"
s.add_dependency 'bcrypt-ruby', '~> 3.0.0'
s.add_dependency 'omniauth-identity'

Expand Down
4 changes: 2 additions & 2 deletions lib/let_me_in/linked_accounts/identity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def find_or_create_by_auth_hash(auth_hash)
end

def authenticate(username_or_email, password)
user = where(["email=:username_or_email or username=:username_or_email",
:username_or_email => username_or_email]).first
user = where(["email=:username_or_email or username=:username_or_email",
{:username_or_email => username_or_email}]).first
user.try(:authenticate, password)
end

Expand Down
9 changes: 0 additions & 9 deletions spec/dummy/config/initializers/linked_accounts.rb

This file was deleted.

0 comments on commit 3e1f86c

Please sign in to comment.