lib/sinatra/auth/github.rb in sinatra_auth_github-0.12.0 vs lib/sinatra/auth/github.rb in sinatra_auth_github-0.12.1

- old
+ new

@@ -161,12 +161,16 @@ end app.helpers Helpers app.get '/auth/github/callback' do - authenticate! - return_to = session.delete('return_to') || _relative_url_for('/') - redirect return_to + if params["error"] + redirect "/unauthenticated" + else + authenticate! + return_to = session.delete('return_to') || _relative_url_for('/') + redirect return_to + end end end end end end