Reputation: 15117
I am trying to learn the insides of omniauth and am curious as to how it knows to intercept /auth/facebook url. Does it append to the existing routes file? Where can I find the insides of it?
Upvotes: 0
Views: 194
Reputation: 19485
It uses a rack middleware to sniff the path that's being requested, and if it matches, calls the associated strategy. The files in question are lib/omniauth.rb
and lib/omniauth/strategy.rb
.
To see the path taken, start at the call!
method in strategy.rb
. Pay special attention to anything checking for path_prefix
, which defaults to /auth
.
Upvotes: 3