sorcery 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sorcery might be problematic. Click here for more details.

data/README.rdoc CHANGED
@@ -28,7 +28,7 @@ Railscast: http://railscasts.com/episodes/283-authentication-with-sorcery
28
28
 
29
29
  Example Rails 3 app using sorcery: https://github.com/NoamB/sorcery-example-app
30
30
 
31
- Documentation: http://rubydoc.info/gems/sorcery/0.7.1/frames
31
+ Documentation: http://rubydoc.info/gems/sorcery/0.7.2/frames
32
32
 
33
33
  Check out the tutorials in the github wiki!
34
34
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.1
1
+ 0.7.2
@@ -33,7 +33,7 @@ module Sorcery
33
33
  # Generate the model and add 'authenticates_with_sorcery!' unless you passed --migrations
34
34
  unless options[:migrations]
35
35
  generate "model #{model_class_name} --skip-migration"
36
- insert_into_file "app/models/#{model_class_name}.rb", " authenticates_with_sorcery!\n", :after => "class #{model_class_name} < ActiveRecord::Base\n"
36
+ insert_into_file "app/models/#{model_class_name.downcase}.rb", " authenticates_with_sorcery!\n", :after => "class #{model_class_name} < ActiveRecord::Base\n"
37
37
  end
38
38
  end
39
39
 
@@ -29,6 +29,8 @@ module Sorcery
29
29
 
30
30
  def find_by_id(id)
31
31
  find(id)
32
+ rescue ::Mongoid::Errors::DocumentNotFound
33
+ nil
32
34
  end
33
35
 
34
36
  def find_by_activation_token(token)
data/sorcery.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "sorcery"
8
- s.version = "0.7.1"
8
+ s.version = "0.7.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Noam Ben Ari"]
data/spec/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- sorcery (0.7.0)
4
+ sorcery (0.7.1)
5
5
  bcrypt-ruby (~> 3.0.0)
6
6
  mongo_mapper
7
7
  oauth (~> 0.4.4)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- sorcery (0.7.0)
4
+ sorcery (0.7.1)
5
5
  bcrypt-ruby (~> 3.0.0)
6
6
  mongo_mapper
7
7
  oauth (~> 0.4.4)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- sorcery (0.7.0)
4
+ sorcery (0.7.1)
5
5
  bcrypt-ruby (~> 3.0.0)
6
6
  mongo_mapper
7
7
  oauth (~> 0.4.4)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- sorcery (0.7.0)
4
+ sorcery (0.7.1)
5
5
  bcrypt-ruby (~> 3.0.0)
6
6
  mongo_mapper
7
7
  oauth (~> 0.4.4)
File without changes
@@ -94,6 +94,17 @@ describe ApplicationController do
94
94
  end
95
95
 
96
96
  specify { should respond_to(:require_login) }
97
+
98
+ it "should call the configured 'not_authenticated_action' when session[:user_id] isn't found" do
99
+ # If someone passes in a bogus user_id than no big deal, but if a user is deleted
100
+ # and there is still an active session out there for him this causes problems.
101
+ user = User.create(:email => 'test@example.com', :password => 'password')
102
+ session[:user_id] = user.id
103
+ user.destroy
104
+ sorcery_controller_property_set(:not_authenticated_action, :test_not_authenticated_action)
105
+ get :test_logout
106
+ response.body.should == "test_not_authenticated_action"
107
+ end
97
108
 
98
109
  it "should call the configured 'not_authenticated_action' when authenticate before_filter fails" do
99
110
  session[:user_id] = nil
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sorcery
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.7.1
5
+ version: 0.7.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Noam Ben Ari