Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make record generation for auto-registration more modular to allow cu…

…stom modifications
  • Loading branch information...
commit 4a1f644be36aec75ae2d35121904b5a846354233 1 parent aff4f5e
@mreinsch authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/authlogic_openid/session.rb
View
12 lib/authlogic_openid/session.rb
@@ -109,10 +109,7 @@ def validate_by_openid
if !attempted_record
if auto_register?
- auto_reg_record = klass.new
- auto_reg_record.openid_identifier = openid_identifier
- auto_reg_record.send(:map_openid_registration, registration)
-
+ auto_reg_record = create_open_id_auto_register_record(openid_identifier, registration)
if !auto_reg_record.save
auto_reg_record.errors.each {|attr, msg| errors.add(attr, msg) }
else
@@ -124,6 +121,13 @@ def validate_by_openid
end
end
end
+
+ def create_open_id_auto_register_record(openid_identifier, registration)
+ returning klass.new do |auto_reg_record|
+ auto_reg_record.openid_identifier = openid_identifier
+ auto_reg_record.send(:map_openid_registration, registration)
+ end
+ end
def validate_openid_error
errors.add(:openid_identifier, @openid_error) if @openid_error
Please sign in to comment.
Something went wrong with that request. Please try again.