authn 3.5.0 → 3.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -14,7 +14,7 @@ In addition you can bring in other behavior sets like:
14
14
  * authn-activation: Account activation
15
15
  * authn-protection: Failed login protection
16
16
  * authn-recovery: Password recovery
17
- * rails-authn: Extend Rails with AuthN
17
+ * authn-rails: Extend Rails with AuthN
18
18
 
19
19
  Using AuthN
20
20
  ===========
@@ -112,7 +112,7 @@ Or install it yourself as:
112
112
  $ gem install authn
113
113
 
114
114
  Looking for instructions on how to setup with Rails?
115
- Find them over [here](https://github.com/krainboltgreene/rails-authn)
115
+ Find them over [here](https://github.com/krainboltgreene/authn-rails)
116
116
 
117
117
 
118
118
  Contributing
data/lib/authn/model.rb CHANGED
@@ -41,6 +41,7 @@ module AuthN
41
41
  private
42
42
 
43
43
  def merge_config_with(options)
44
+ options[:account_klass] = name unless options.has_key? :account_klass
44
45
  config.merge! AuthN.config.dump.merge options
45
46
  end
46
47
  end
data/lib/authn/session.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  module AuthN
2
2
  module Session
3
+ private
3
4
  def login(identifiers, klass = AuthN.config.account_klass)
4
5
  generate_session_and_instance_from find_instance_klass(klass).authenticate identifiers
5
6
  end
@@ -26,7 +27,9 @@ module AuthN
26
27
 
27
28
  alias_method :current_account, :current_user
28
29
 
29
- private
30
+ def require_login
31
+ unauthenticated unless logged_in?
32
+ end
30
33
 
31
34
  def find_instance_klass(klass)
32
35
  Object.const_get klass.capitalize
data/lib/authn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module AuthN
2
- VERSION = "3.5.0"
2
+ VERSION = "3.7.2"
3
3
  end
@@ -52,15 +52,15 @@ class TestAuthNModel < MiniTest::Unit::TestCase
52
52
  assert Account.authenticate(email: "kurtis@example.com", password: "12341234").is_a? Account
53
53
  end
54
54
 
55
- def test_authenticate_returns_false_if_bad_password
56
- actual =
57
- expected =
58
- assert_equal expected, actual
59
- end
55
+ # def test_authenticate_returns_false_if_bad_password
56
+ # actual =
57
+ # expected =
58
+ # assert_equal expected, actual
59
+ # end
60
60
 
61
- def test_authenticate_return_nil_if_no_record_found
62
- actual =
63
- expected =
64
- assert_equal expected, actual
65
- end
61
+ # def test_authenticate_return_nil_if_no_record_found
62
+ # actual =
63
+ # expected =
64
+ # assert_equal expected, actual
65
+ # end
66
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authn
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-09 00:00:00.000000000 Z
12
+ date: 2012-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -131,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  segments:
133
133
  - 0
134
- hash: -1477380080716510232
134
+ hash: -4353951558489983724
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  none: false
137
137
  requirements:
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: -1477380080716510232
143
+ hash: -4353951558489983724
144
144
  requirements: []
145
145
  rubyforge_project:
146
146
  rubygems_version: 1.8.24