def password_authentication
user = User.try_to_login(params[:username], params[:password])
+
if user.nil?
- # Invalid credentials
- flash.now[:error] = l(:notice_account_invalid_creditentials)
+ invalid_credentials
elsif user.new_record?
onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id })
else
render :action => 'register'
end
+ def invalid_credentials
+ flash.now[:error] = l(:notice_account_invalid_creditentials)
+ end
+
# Register a user for email activation.
#
# Pass a block for behavior when a user fails to save