Permalink
Browse files

Basic oauth error handling

  • Loading branch information...
1 parent 23fc289 commit 4f1bb4de1a862b9eb4eefb3dcd33c91aa81e2c3d @rwdaigle committed Oct 9, 2012
@@ -21,4 +21,8 @@ def create
redirect_to status_gists_path
end
end
+
+ def failure
+ log({ns: self.class, fn: __method__, measure: true, at: 'login-failure'}, request.env['omniauth.auth'])
+ end
end
@@ -0,0 +1,3 @@
+%h4 Oops!
+%p= params[:message]
+%p= link_to "Go back", root_path
@@ -33,7 +33,7 @@ def log_exception(*segments, exception)
def log_data_from(*segments)
segments.inject({}) do |map, segment|
- map.merge!(segment.to_log)
+ segment.nil? ? map : map.merge!(segment.to_log)
end
end
View
@@ -6,6 +6,7 @@
match '/login', to: 'sessions#login', :as => :login
match '/logout', to: 'sessions#logout', :as => :logout
match '/auth/github/callback', to: 'sessions#create', :via => [:post, :get], :as => :github_auth_callback
+ match '/auth/failure', to: 'sessions#failure'
# Though this was an option at one time?
all = [:index, :show, :new, :create, :edit, :update, :destroy]

0 comments on commit 4f1bb4d

Please sign in to comment.