1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00

Fixing registration post phase.

This commit is contained in:
Michael Bleigh 2011-05-16 13:13:35 -05:00
parent 21e5fd0c09
commit e96a4688e4
2 changed files with 6 additions and 0 deletions

View file

@ -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

View file

@ -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