Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

let exceptions bubble up

:punch: sinatra in the throat
  • Loading branch information...
commit 125d38b450a0e2448baaa5a04d56b0e496587773 1 parent 5aefdfd
Simon Rozet authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/sinatra/auth/github.rb
6 lib/sinatra/auth/github.rb
View
@@ -10,6 +10,9 @@ module Github
# Simple way to serve an image early in the stack and not get blocked by
# application level before filters
class AccessDenied < Sinatra::Base
+ enable :raise_errors
+ disable :show_exceptions
+
get '/_images/securocat.png' do
send_file(File.join(File.dirname(__FILE__), "views", "securocat.png"))
end
@@ -17,6 +20,9 @@ class AccessDenied < Sinatra::Base
# The default failure application, this is overridable from the extension config
class BadAuthentication < Sinatra::Base
+ enable :raise_errors
+ disable :show_exceptions
+
helpers do
def unauthorized_template
@unauthenticated_template ||= File.read(File.join(File.dirname(__FILE__), "views", "401.html"))
Please sign in to comment.
Something went wrong with that request. Please try again.