rebelhold/omniauth-identity — pull request #1 by rrix (2012-05-17 07:53:21+00:00)
Title: Validation hooks

Adds a validate_user option to OmniAuth-Identity which, if included, is a method that is called when the registration_phase starts. This means you can do "cool" things like:
```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
provider :identity,
model: User,
fields: [:email, :first_name, :last_name, :phone, :title],
on_failed_registration: lambda { |env| HomeController.action(:index).call(env) },
validate_user: lambda { |env| ApplicationHelper.validate(env) }
end
```

Which seems like a good idea and all, right? Basically, without this, it's damn near impossible to have any sort of application-side validation, without implementing recaptcha in the Model. This gives us some semblance of a sane reality, though there are some... hairy details, as you'll see in my bulletin builder pull request.