Skip to content

Commit

Permalink
Better exception message.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Feb 3, 2012
1 parent 7e3ccbe commit 53894e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/devise/rails/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,10 @@ def devise_omniauth_callback(mapping, controllers) #:nodoc:
path_prefix = "/#{mapping.path}/auth".squeeze("/")

if ::OmniAuth.config.path_prefix && ::OmniAuth.config.path_prefix != path_prefix
raise "You can only add :omniauthable behavior to one Devise model"
raise "Wrong OmniAuth configuration. If you are getting this exception, it means that either:\n\n" \
"1) You are manually setting OmniAuth.config.path_prefix and it doesn't match the Devise one\n" \
"2) You are setting :omniauthable in more than one model\n" \
"3) You changed your Devise routes/OmniAuth setting and haven't restarted your server"
else
::OmniAuth.config.path_prefix = path_prefix
end
Expand Down

0 comments on commit 53894e1

Please sign in to comment.