Permalink
Browse files

updated to v0.7.4

  • Loading branch information...
1 parent 9b4a72f commit 8016ac06204c9af41c2e28707f37da91cab25163 @NoamB committed Nov 5, 2011
Showing with 24 additions and 12 deletions.
  1. +1 −1 Gemfile
  2. +4 −4 Gemfile.lock
  3. +9 −0 app/controllers/oauths_controller.rb
  4. +1 −1 config/environments/production.rb
  5. +1 −1 config/initializers/sorcery.rb
  6. +8 −5 db/schema.rb
View
@@ -10,7 +10,7 @@ gem 'mysql2', '0.2.11'
# Bundle the extra gems:
-gem 'sorcery', '0.6.1'
+gem 'sorcery', '0.7.4'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
View
@@ -38,7 +38,7 @@ GEM
faraday (0.6.1)
addressable (~> 2.2.4)
multipart-post (~> 1.1.0)
- rack (< 2, >= 1.1.0)
+ rack (>= 1.1.0, < 2)
i18n (0.5.0)
mail (2.2.19)
activesupport (>= 2.3.6)
@@ -88,7 +88,7 @@ GEM
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.5.0)
- sorcery (0.6.1)
+ sorcery (0.7.4)
bcrypt-ruby (~> 3.0.0)
oauth (~> 0.4.4)
oauth (~> 0.4.4)
@@ -99,7 +99,7 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.29)
+ tzinfo (0.3.30)
PLATFORMS
ruby
@@ -109,5 +109,5 @@ DEPENDENCIES
rails (= 3.0.9)
rspec (~> 2.5.0)
rspec-rails (~> 2.5.0)
- sorcery (= 0.6.1)
+ sorcery (= 0.7.4)
test-unit (~> 2.3.0)
@@ -1,3 +1,4 @@
+require 'oauth2'
class OauthsController < ApplicationController
skip_before_filter :require_login
@@ -9,6 +10,7 @@ def oauth
def callback
provider = params[:provider]
+ begin
if @user = login_from(provider)
redirect_to root_path, :notice => "Logged in from #{provider.titleize}!"
else
@@ -22,5 +24,12 @@ def callback
redirect_to root_path, :alert => "Failed to login from #{provider.titleize}!"
end
end
+ rescue ::OAuth2::Error => e
+ p e
+ puts e.code
+ puts e.description
+ puts e.message
+ puts e.backtrace
+ end
end
end
@@ -29,7 +29,7 @@
# Disable Rails's static asset server
# In production, Apache or nginx will already do this
- config.serve_static_assets = false
+ config.serve_static_assets = true
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
@@ -20,7 +20,7 @@
config.facebook.user_info_mapping = {:email => "name"}
config.user_config do |user|
- user.username_attribute_name = :email
+ user.username_attribute_names = [:email]
user.subclasses_inherit_config = true
user.user_activation_mailer = UserMailer
View
@@ -21,20 +21,23 @@
end
create_table "users", :force => true do |t|
- t.string "email", :null => false
- t.string "crypted_password", :null => false
- t.string "salt", :null => false
+ t.string "email", :null => false
+ t.string "crypted_password"
+ t.string "salt"
t.datetime "created_at"
t.datetime "updated_at"
t.string "activation_state"
t.string "activation_code"
+ t.datetime "activation_code_expires_at"
t.string "remember_me_token"
t.datetime "remember_me_token_expires_at"
- t.string "reset_password_code"
+ t.string "reset_password_token"
+ t.datetime "reset_password_token_expires_at"
+ t.datetime "reset_password_email_sent_at"
t.datetime "last_login_at"
t.datetime "last_logout_at"
t.datetime "last_activity_at"
- t.integer "failed_logins_count", :default => 0
+ t.integer "failed_logins_count", :default => 0
t.datetime "lock_expires_at"
t.string "type"
end

0 comments on commit 8016ac0

Please sign in to comment.