diff --git a/oa-identity/lib/omniauth/identity/models/active_record.rb b/oa-identity/lib/omniauth/identity/models/active_record.rb index 09c339b..3bfbe9c 100644 --- a/oa-identity/lib/omniauth/identity/models/active_record.rb +++ b/oa-identity/lib/omniauth/identity/models/active_record.rb @@ -9,6 +9,11 @@ module OmniAuth self.abstract_class = true has_secure_password + + def self.auth_key=(key) + super + validates_uniqueness_of key, :case_sensitive => false + end def self.locate(key) where(auth_key => key).first diff --git a/oa-identity/lib/omniauth/strategies/identity.rb b/oa-identity/lib/omniauth/strategies/identity.rb index e49c708..5525fa7 100644 --- a/oa-identity/lib/omniauth/strategies/identity.rb +++ b/oa-identity/lib/omniauth/strategies/identity.rb @@ -55,6 +55,7 @@ module OmniAuth def registration_phase attributes = (options[:fields] + [:password, :password_confirmation]).inject({}){|h,k| h[k] = request[k.to_s]; h} if @identity = model.create(attributes) + env['PATH_INFO'] = callback_path callback_phase else registration_form