easy_auth-password 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ class Identities::Password < Identity
2
+ include EasyAuth::Models::Identities::Password
3
+ end
@@ -6,15 +6,15 @@ module EasyAuth::Controllers::PasswordReset
6
6
  end
7
7
 
8
8
  def new
9
- @identity = EasyAuth.password_identity_model.new
9
+ @identity = EasyAuth.find_identity_model(params).new
10
10
  end
11
11
 
12
12
  def create
13
- if @identity = EasyAuth.password_identity_model.where(:username => params[:identities_password][:username]).first
13
+ if @identity = EasyAuth.find_identity_model(params).where(:username => params[:identities_password][:username]).first
14
14
  @identity.generate_reset_token!
15
15
  PasswordResetMailer.reset(@identity.id).deliver
16
16
  else
17
- @identity = EasyAuth.password_identity_model.new(params[:identities_password])
17
+ @identity = EasyAuth.find_identity_model(params).new(params[:identities_password])
18
18
  end
19
19
 
20
20
  flash.now[:notice] = I18n.t('easy_auth.password_reset.create.notice')
@@ -36,7 +36,7 @@ module EasyAuth::Controllers::PasswordReset
36
36
  end
37
37
 
38
38
  def find_identity_from_reset_token
39
- @identity = EasyAuth.password_identity_model.where(:reset_token => params[:reset_token].to_s).first
39
+ @identity = EasyAuth.find_identity_model(params).where(:reset_token => params[:reset_token].to_s).first
40
40
  @identity.password_reset = true
41
41
  end
42
42
 
@@ -11,10 +11,6 @@ module EasyAuth
11
11
  autoload :Models
12
12
  end
13
13
 
14
- def self.password_identity_model(controller = nil)
15
- EasyAuth::Identities::Password
16
- end
17
-
18
14
  module Controllers
19
15
  autoload :PasswordReset
20
16
 
@@ -4,15 +4,4 @@ module EasyAuth::Password::Controllers::Sessions
4
4
  reverse_included do
5
5
  before_filter :no_authentication, :only => :new, :if => Proc.new { params[:identity] == :password }
6
6
  end
7
-
8
- private
9
-
10
- def after_successful_sign_in_with_password(identity)
11
- end
12
-
13
- def after_successful_sign_in_url_with_password(identity)
14
- end
15
-
16
- def after_failed_sign_in_with_password(identity)
17
- end
18
7
  end
@@ -15,7 +15,7 @@ module EasyAuth::Password::Models::Account
15
15
  before_update :update_password_identity, :if => :run_password_identity_validations?
16
16
 
17
17
  # Associations
18
- has_one :password_identity, :class_name => 'EasyAuth::Identities::Password', :foreign_key => :account_id
18
+ has_one :password_identity, :class_name => 'Identities::Password', :foreign_key => :account_id
19
19
  end
20
20
 
21
21
  def run_password_identity_validations?
@@ -25,7 +25,7 @@ module EasyAuth::Password::Models::Account
25
25
  private
26
26
 
27
27
  def setup_password_identity
28
- self.identities << EasyAuth.password_identity_model.new(password_identity_attributes)
28
+ self.identities << EasyAuth.find_identity_model(:identity => :password).new(password_identity_attributes)
29
29
  end
30
30
 
31
31
  def update_password_identity
@@ -1,5 +1,5 @@
1
1
  module EasyAuth
2
2
  module Password
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_auth-password
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
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-11-02 00:00:00.000000000 Z
12
+ date: 2012-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: easy_auth
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.1.0
21
+ version: 0.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.1.0
29
+ version: 0.2.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: sqlite3
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -197,7 +197,7 @@ extra_rdoc_files: []
197
197
  files:
198
198
  - app/controllers/password_reset_controller.rb
199
199
  - app/mailers/password_reset_mailer.rb
200
- - app/models/easy_auth/identities/password.rb
200
+ - app/models/identities/password.rb
201
201
  - app/views/password_reset/edit.html.erb
202
202
  - app/views/password_reset/new.html.erb
203
203
  - app/views/password_reset_mailer/reset.html.erb
@@ -217,7 +217,6 @@ files:
217
217
  - lib/easy_auth/password/version.rb
218
218
  - lib/easy_auth/password.rb
219
219
  - lib/easy_auth-password.rb
220
- - lib/tasks/easy_auth_tasks.rake
221
220
  - Rakefile
222
221
  - README.md
223
222
  homepage: https://github.com/dockyard/easy_auth-password
@@ -234,7 +233,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
233
  version: '0'
235
234
  segments:
236
235
  - 0
237
- hash: 3669041279694489791
236
+ hash: -4240566048460302950
238
237
  required_rubygems_version: !ruby/object:Gem::Requirement
239
238
  none: false
240
239
  requirements:
@@ -243,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
242
  version: '0'
244
243
  segments:
245
244
  - 0
246
- hash: 3669041279694489791
245
+ hash: -4240566048460302950
247
246
  requirements: []
248
247
  rubyforge_project:
249
248
  rubygems_version: 1.8.23
@@ -1,3 +0,0 @@
1
- class EasyAuth::Identities::Password < EasyAuth::Identity
2
- include EasyAuth::Models::Identities::Password
3
- end
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :easy_auth do
3
- # # Task goes here
4
- # end