It seems in some cases I can use the redirect
match '/auth/:provider/callback', :to => redirect {|params| "/
omniauth_callbacks/#{params[:provider]}" }
but not in this case , as the redirect will change the request , and
I'll not be able to check for request.env["omniauth.auth"]
so I resolved to write one match for each :provider .
match '/auth/google_oauth2/callback', to:
'omniauth_callbacks#google_oauth2'
match '/auth/facebook/callback', to: 'omniauth_callbacks#facebook'
match '/auth/twitter/callback', to: 'omniauth_callbacks#twitter'